private function determinePreviouslyStored($model)
    {
        $store = $this->_toolbox->getTransactionManager()->searchCommandsByActionAndObject('PodManager:store', $model);
        $delete = $this->_toolbox->getTransactionManager()->searchCommandsByActionAndObject('PodManager:delete', $model);

        $storePosition = $store ? $store['position'] : -1;
        $deletePosition = $delete ? $delete['position'] : -1;

        if ($deletePosition >= $storePosition) {
            return false;
        } else {
            return $store['id'];
        }
    }
private function determinePreviouslyStored($model)
    {
        $store = $this->_toolbox->getTransactionManager()->searchCommandsByActionAndObject('PodManager:store', $model);
        $delete = $this->_toolbox->getTransactionManager()->searchCommandsByActionAndObject('PodManager:delete', $model);

        $storePosition = $store ? $store['position'] : -1;
        $deletePosition = $delete ? $delete['position'] : -1;

        if ($deletePosition >= $storePosition) {
            return false;
        } else {
            return $store['id'];
        }
    }
private function determinePreviouslyStored ( $ model ) { $ store = $ this -> _toolbox -> getTransactionManager ( ) -> searchCommandsByActionAndObject ( 'PodManager:store' , $ model ) ; $ delete = $ this -> _toolbox -> getTransactionManager ( ) -> searchCommandsByActionAndObject ( 'PodManager:delete' , $ model ) ; $ storePosition = $ store ? $ store [ 'position' ] : - 1 ; $ deletePosition = $ delete ? $ delete [ 'position' ] : - 1 ; if ( $ deletePosition >= $ storePosition ) { return false ; } else { return $ store [ 'id' ] ; } }
Because transactions are executed in 1 go, this helps us deteremine if the pod has a previous command to store it.
We can then use its id to work with it in the transaction.
@param  AModel         $model The model to determine whether to delete or not.
@return boolean|string
Because transactions are executed in 1 go this helps us deteremine if the pod has a previous command to store it . We can then use its id to work with it in the transaction .