src/Pok/PoolDBM/Transaction.php
public function persist($model)
    {
        $class    = $this->manager->getClassMetadata(get_class($model));
        $managers = $class->getFieldManagerNames();
        $pool     = $this->manager->getPool();
        $priority = $pool->getPriority('transaction');

        $id = null;

        if ($class->hasManagerReferenceGenerator()) {
            $managerName = $class->getManagerReferenceGenerator();
            $referenceModel = $model->{'get' . ucfirst($managerName)}();

            $pool->getManager($managerName)->persist($referenceModel);
            $id = $referenceModel->getId();

            unset($managers[$managerName]);
        }

        foreach ($managers as $key => $managerName) {
            if (isset($priority[$managerName])) {
                $this->doPersist($managerName, $model, $id);

                unset($managers[$key]); // dereference index
            }
        }

        foreach ($managers as $managerName) {
            $this->addQueue(self::QUEUE_ACTION_PERSIST, $managerName, $model, $id);
        }
    }
public function persist($model)
    {
        $class    = $this->manager->getClassMetadata(get_class($model));
        $managers = $class->getFieldManagerNames();
        $pool     = $this->manager->getPool();
        $priority = $pool->getPriority('transaction');

        $id = null;

        if ($class->hasManagerReferenceGenerator()) {
            $managerName = $class->getManagerReferenceGenerator();
            $referenceModel = $model->{'get' . ucfirst($managerName)}();

            $pool->getManager($managerName)->persist($referenceModel);
            $id = $referenceModel->getId();

            unset($managers[$managerName]);
        }

        foreach ($managers as $key => $managerName) {
            if (isset($priority[$managerName])) {
                $this->doPersist($managerName, $model, $id);

                unset($managers[$key]); // dereference index
            }
        }

        foreach ($managers as $managerName) {
            $this->addQueue(self::QUEUE_ACTION_PERSIST, $managerName, $model, $id);
        }
    }
public function persist ( $ model ) { $ class = $ this -> manager -> getClassMetadata ( get_class ( $ model ) ) ; $ managers = $ class -> getFieldManagerNames ( ) ; $ pool = $ this -> manager -> getPool ( ) ; $ priority = $ pool -> getPriority ( 'transaction' ) ; $ id = null ; if ( $ class -> hasManagerReferenceGenerator ( ) ) { $ managerName = $ class -> getManagerReferenceGenerator ( ) ; $ referenceModel = $ model -> { 'get' . ucfirst ( $ managerName ) } ( ) ; $ pool -> getManager ( $ managerName ) -> persist ( $ referenceModel ) ; $ id = $ referenceModel -> getId ( ) ; unset ( $ managers [ $ managerName ] ) ; } foreach ( $ managers as $ key => $ managerName ) { if ( isset ( $ priority [ $ managerName ] ) ) { $ this -> doPersist ( $ managerName , $ model , $ id ) ; unset ( $ managers [ $ key ] ) ; // dereference index } } foreach ( $ managers as $ managerName ) { $ this -> addQueue ( self :: QUEUE_ACTION_PERSIST , $ managerName , $ model , $ id ) ; } }
Saves a model.

@param mixed $model
Saves a model .