Service for interacting with creditors
@return Services\CreditorsService
192834
public function creditors()
    {
        if (!isset($this->creditors)) {
            $this->creditors = new Services\CreditorsService($this->api_client);
        }

        return $this->creditors;
    }
980161
public function index()
    {
        $request = $this->makeRequest('index');
        $result = $this->service->getAll();

        return $this->maybeMakeResource('collection', $result);
    }
876018
public function onRelationManageRemove()
    {
        $this->beforeAjax();

        $recordId = post('record_id');
        $sessionKey = $this->deferredBinding ? $this->relationGetSessionKey() : null;
        $relatedModel = $this->relationModel;

        /*
         * Remove
         */
        if ($this->viewMode == 'multi') {

            $checkedIds = $recordId ? [$recordId] : post('checked');

            if (is_array($checkedIds)) {
                $foreignKeyName = $relatedModel->getKeyName();

                $models = $relatedModel->whereIn($foreignKeyName, $checkedIds)->get();
                foreach ($models as $model) {
                    $this->relationObject->remove($model, $sessionKey);
                }
            }
        }
        /*
         * Unlink
         */
        elseif ($this->viewMode == 'single') {
            if ($this->relationType == 'belongsTo') {
                $this->relationObject->dissociate();
                $this->relationObject->getParent()->save();
            }
            elseif ($this->relationType == 'hasOne' || $this->relationType == 'morphOne') {
                if ($obj = $relatedModel->find($recordId)) {
                    $this->relationObject->remove($obj, $sessionKey);
                }
                elseif ($this->viewModel->exists) {
                    $this->relationObject->remove($this->viewModel, $sessionKey);
                }
            }

            $this->viewWidget->setFormValues([]);
        }

        return $this->relationRefresh();
    }
280927
public function call()
    {
        // Association of parmatres at the request
        foreach ($this->keys as $key => $value) {
            if (!isset($this->match[$key])) {
                continue;
            }

            if (!is_int($this->match[$key])) {
                $this->params[$value] = urldecode($this->match[$key]);

                continue;
            }

            $tmp = (int) $this->match[$key];

            $this->params[$value] = $tmp;

            $this->match[$key] = $tmp;
        }

        return Actionner::getInstance()->call($this->cb, $this->match);
    }
501261
public function getUpdateService()
    {
        if (null == $this->updateService) {
            $this->setUpdateService(
                new EntityUpdateService($this->getNewEntity())
            );
        }
        return $this->updateService;
    }
268022
public function getDraftCollectionAction()
    {
        $contents = $this->getEntityManager()
            ->getRepository('BackBee\ClassContent\Revision')
            ->getAllDrafts($this->getApplication()->getBBUserToken())
        ;

        $contents = $this->sortDraftCollection($contents);

        return $this->addContentRangeHeadersToResponse($this->createJsonResponse($contents), $contents, 0);
    }
224055
public function getReplies()
    {
        $this->channel
            ->basic_consume(
                $this->queueName,
                $this->queueName,
                false,
                true,
                false,
                false,
                array($this, 'processMessage')
            );

        while (count($this->replies) < $this->requests) {
            $this->channel
                ->wait(null, false, $this->requestTimeout);
        }

        $this->channel
            ->basic_cancel($this->queueName);

        return $this->replies;
    }
1172362
function newService()
    {
        $callable = $this->callable;
        if ($callable === null)
            ## no callable provided but rather not throw exception
            throw new \Exception('No Factory Callable Provided.');
        
        // ..
        // DO_LEAST_PHPVER_SUPPORT 5.4 Closure Bind
        if ($callable instanceof \Closure && version_compare(phpversion(), '5.4.0') > 0)
            $callable = $callable->bindTo($this);

        return call_user_func( $callable, $this->services() );
    }
931071
public function getItemService()
    {
        if (is_null($this->itemService)) {
            $this->itemService = taoItems_models_classes_ItemsService::singleton();
        }
        return $this->itemService;
    }
795322
public function remove()
    {
        $transaction = static::getDb()->beginTransaction();
        try {
            $clearCache = false;
            if ($this->receiver_status == self::STATUS_NEW) {
                $clearCache = true;
            }
            $deleteParent = null;
            $this->scenario = 'remove';
            if ($this->message->sender_status != Message::STATUS_DELETED) {
                $this->receiver_status = self::STATUS_DELETED;
                if (!$this->save()) {
                    throw new Exception('Message status changing error!');
                }
                if ($clearCache) {
                    Podium::getInstance()->podiumCache->deleteElement('user.newmessages', $this->receiver_id);
                }
                $transaction->commit();
                return true;
            }
            if ($this->message->sender_status == Message::STATUS_DELETED && count($this->message->messageReceivers) == 1) {
                $deleteParent = $this->message;
            }
            if (!$this->delete()) {
                throw new Exception('Message removing error!');
            }
            if ($clearCache) {
                Podium::getInstance()->podiumCache->deleteElement('user.newmessages', $this->receiver_id);
            }
            if ($deleteParent) {
                if (!$deleteParent->delete()) {
                    throw new Exception('Sender message deleting error!');
                }
            }
            $transaction->commit();
            return true;
        } catch (Exception $e) {
            $transaction->rollBack();
            Log::error($e->getMessage(), $this->id, __METHOD__);
        }
        return false;
    }
1161387
public function treat()
    {
        if (!$this->isTreated) {
            $this->initFetchValues();
            $this->isTreated = TRUE;
            if ($this->isActive()) {
                $this->validFetchValues();
            }
        }
        return $this;
    }
1240639
public function edit()
    {
        $builder = (new ManagementBuilder(TransactionType::EDIT))
            ->withPaymentMethod($this->transactionReference);

        if ($this->commercialIndicator !== null) {
            $builder = $builder->withModifier(TransactionModifier::LEVEL_II);
        }

        return $builder;
    }
30856
public function getServiceBroker()
    {
        if (!$this->serviceBroker && $this->serviceLocator) {
            $this->setServiceBroker($this->serviceLocator->get('ServiceBroker'));
        }
        
        if (!$this->serviceBroker instanceof ServiceBroker) {
            throw new RuntimeException(
                'Unable to execute Job; Job is not correctly initialized (ServiceBroker is not available)');
        }
        
        return $this->serviceBroker;
    }
1225280
public function subscribersAndGuestSync()
    {
        //sync subscribers
        $subscriberModel = $this->subscriberFactory->create();
        $result = $subscriberModel->sync();

        //un-subscribe suppressed contacts
        $subscriberModel->unsubscribe();

        //sync guests
        $this->guestFactory->create()->sync();

        return $result;
    }
336992
public function getEntityService()
    {
        if (null === $this->entityService) {
            $entityServiceClass = $this->getEntityServiceClass();
            if (!class_exists($entityServiceClass)) {
                throw new \RuntimeException("Classe $entityServiceClass inexistente!");
            }
            $this->entityService = new $entityServiceClass();
            $this->entityService->setServiceLocator($this->getServiceLocator());
        }

        return $this->entityService;
    }
169109
public function processPayment()
    {
        $paymentMethod = $this
            ->methodFactory
            ->create();

        /**
         * At this point, order must be created given a card, and placed in
         * PaymentBridge.
         *
         * So, $this->paymentBridge->getOrder() must return an object
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderLoad(
                $this->paymentBridge,
                $paymentMethod
            );

        /**
         * Order exists right here.
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderCreated(
                $this->paymentBridge,
                $paymentMethod
            );

        /**
         * Payment paid done.
         *
         * Paid process has ended (No matters result)
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderDone(
                $this->paymentBridge,
                $paymentMethod
            );

        /**
         * Payment paid successfully.
         *
         * Paid process has ended successfully
         */
        $this
            ->paymentEventDispatcher
            ->notifyPaymentOrderSuccess(
                $this->paymentBridge,
                $paymentMethod
            );

        return $this;
    }
808643
public function actionNgrestOrder()
    {
        $apiEndpoint = Yii::$app->request->getBodyParam('apiEndpoint');
        $sort = Yii::$app->request->getBodyParam('sort');
        $field = Yii::$app->request->getBodyParam('field');
        
        if ($sort == '-') {
            $sort = SORT_DESC;
        } else {
            $sort = SORT_ASC;
        }
        
        return Yii::$app->adminuser->identity->setting->set('ngrestorder.'.$apiEndpoint, ['sort' => $sort, 'field' => $field]);
    }