function doActivityOnProcessFindList() { $mapper =& Piece_ORM::getMapper('Entry'); if (Piece_ORM_Error::hasErrors('exception')) { return; } $this->_entries = $mapper->findAll(); return 'DisplayListFromProcessFindList'; }
public function onRegister() { Piece_ORM::getMapper('Orders')->insert($this->_order); return 'done'; }
function doActivityOnProcessCreateNew() { $mapper =& Piece_ORM::getMapper('Entry'); if (Piece_ORM_Error::hasErrors('exception')) { return; } $mapper->insert($this->_entry); return 'DisplayNewFinishFromProcessCreateNew'; }
/** * Invokes the plugin specific code. */ function invoke() { Piece_ORM::setDatabase($this->_getConfiguration('databaseBackend')); }
/** * Invokes the plugin specific code. * * @throws PIECE_UNITY_ERROR_INVALID_CONFIGURATION */ function invoke() { $configDirectory = $this->_getConfiguration('configDirectory'); if (is_null($configDirectory)) { Piece_Unity_Error::push(PIECE_UNITY_ERROR_INVALID_CONFIGURATION, "The value of the configuration point [ configDirectory ] on the plug-in [ {$this->_name} ] is required."); return; } $cacheDirectory = $this->_getConfiguration('cacheDirectory'); if (is_null($cacheDirectory)) { Piece_Unity_Error::push(PIECE_UNITY_ERROR_INVALID_CONFIGURATION, "The value of the configuration point [ cacheDirectory ] on the plug-in [ {$this->_name} ] is required."); return; } $mapperConfigDirectory = $this->_getConfiguration('mapperConfigDirectory'); if (is_null($mapperConfigDirectory)) { Piece_Unity_Error::push(PIECE_UNITY_ERROR_INVALID_CONFIGURATION, "The value of the configuration point [ mapperConfigDirectory ] on the plug-in [ {$this->_name} ] is required."); return; } Piece_ORM::configure($configDirectory, $cacheDirectory, $mapperConfigDirectory); }
function doActivityOnProcessDelete() { $mapper =& Piece_ORM::getMapper('Entry'); if (Piece_ORM_Error::hasErrors('exception')) { return; } $affectedRows = $mapper->delete($this->_entry); if ($affectedRows) { return 'DisplayDeleteFinishFromProcessDelete'; } else { return 'DisplayErrorFromProcessDelete'; } }