public function initialize()
 {
     parent::initialize();
     $this->primaryKeyField = $this->objectPrototype->primaryKeyField;
     if (!is_string($this->primaryKeyField)) {
         $this->primaryKeyField = 'id';
     }
 }
 public function initialize()
 {
     parent::initialize();
     $this->pk = $this->objectPrototype->pk;
     //pega a pk de nossa entidade
     if (!is_string($this->pk)) {
         //se não for declarada pk ela será id
         $this->pk = 'id';
     }
 }
 public function initialize($tableName, $object)
 {
     $this->table = $tableName;
     $this->resultSetPrototype = new ResultSet();
     $this->resultSetPrototype->setArrayObjectPrototype($object);
     parent::initialize();
     $this->primaryKeyField = $object->primaryKeyField;
     if (!is_string($this->primaryKeyField)) {
         $this->primaryKeyField = 'id';
     }
 }
Beispiel #4
0
 /**
  * Initialize
  *
  * @return void
  */
 public function initialize()
 {
     if ($this->isInitialized) {
         return;
     }
     parent::initialize();
     if (null !== $this->rowClass) {
         $resultSetPrototype = $this->getResultSetPrototype();
         $prototype = new $this->rowClass($this->getAdapter());
         if ($prototype instanceof ServiceLocatorAwareInterface) {
             $prototype->setServiceLocator($this->getServiceLocator());
         }
         $resultSetPrototype->setArrayObjectPrototype($prototype);
     }
 }
Beispiel #5
0
 /**
  * Initialize
  *
  * @return void
  */
 public function initialize()
 {
     if ($this->isInitialized) {
         return;
     }
     // Special case for PostgreSQL sequences:
     if ($this->adapter->getDriver()->getDatabasePlatformName() == "Postgresql") {
         $cfg = $this->getServiceLocator()->getServiceLocator()->get('config');
         $maps = isset($cfg['vufind']['pgsql_seq_mapping']) ? $cfg['vufind']['pgsql_seq_mapping'] : null;
         if (isset($maps[$this->table])) {
             $this->featureSet = new Feature\FeatureSet();
             $this->featureSet->addFeature(new Feature\SequenceFeature($maps[$this->table][0], $maps[$this->table][1]));
         }
     }
     parent::initialize();
     if (null !== $this->rowClass) {
         $resultSetPrototype = $this->getResultSetPrototype();
         $resultSetPrototype->setArrayObjectPrototype($this->initializeRowPrototype());
     }
 }
 /**
  * {@inheritDoc}
  */
 public function initialize()
 {
     if ($this->isInitialized) {
         return;
     }
     $this->sql = $this->sql ?: new Sql($this->adapter, $this->table);
     if (!$this->resultSetPrototype) {
         $rowObjectPrototype = $this->createRow();
         if ($this->resultSetClass) {
             $resultSetPrototype = new $this->resultSetClass(null, $rowObjectPrototype);
         } else {
             $resultSetPrototype = new ResultSet(null, $rowObjectPrototype);
         }
         $this->resultSetPrototype = $resultSetPrototype;
     }
     parent::initialize();
 }
Beispiel #7
0
 public function initialize()
 {
     if ($this->isInitialized) {
         return;
     }
     if (!$this->adapter) {
         $this->adapter = $this->getServiceLocator()->get('Zend\\Db\\Adapter\\Adapter');
     }
     $this->initTableName();
     parent::initialize();
 }