Exemplo n.º 1
0
 public function setClass($class)
 {
     $this->_class = $class;
     $this->_url = Backend::getInstance($this->_backendUri)->getTableFromClass($class) . '/' . $this->_identifier;
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Tests if a definition exists for given $id
  * Returns a t41\Backend\Adapter\AbstractAdapter instance if object definition includes a default backend value
  * 
  * @param string $id
  * @return t41\Backend\Adapter\AbstractAdapter
  * @throws ObjectModel\Exception
  */
 public static function getObjectBackend($id)
 {
     if (!self::definitionExists($id)) {
         throw new ObjectModel\Exception(array('NO_CLASS_DECLARATION', $id));
     }
     if (isset(self::$_config[$id]['backend'])) {
         return Backend::getInstance(Backend::PREFIX . self::$_config[$id]['backend']);
     } else {
         return Backend::getDefaultBackend();
     }
 }