Inheritance: extends Selection
Ejemplo n.º 1
0
 /**
  * @param  \Nette\Database\Table\Selection
  * @param  string
  * @param  string
  */
 public function __construct(\Nette\Database\Table\Selection $refTable, $name, $column)
 {
     parent::__construct($refTable, $name, $column);
     if (!$refTable instanceof IModelManagerAccessor) {
         throw new InvalidArgumentException('Argument $refTable must be IModelManagerAccessor descendant.');
     }
     $this->manager = $this->refTable->getModelManager();
 }
Ejemplo n.º 2
0
 protected function execute()
 {
     if ($this->rows !== NULL) {
         return;
     }
     parent::execute();
     if ($this->accessedColumns) {
         $this->accessedColumns[$this->column] = TRUE;
     }
     $this->onExecute();
 }
Ejemplo n.º 3
0
 /**
  * Returns referencing rows.
  * @param  string table name
  * @return GroupedSelection
  */
 public function getReferencingTable($table)
 {
     $column = $this->connection->databaseReflection->getReferencingColumn($table, $this->name);
     $referencing = new GroupedSelection($table, $this, $column);
     $referencing->where("{$table}.{$column}", array_keys((array) $this->rows));
     // (array) - is NULL after insert
     return $referencing;
 }
Ejemplo n.º 4
0
 /**
  * Returns referencing rows.
  * @param  string
  * @param  string
  * @return GroupedSelection
  */
 public function getReferencingTable($table, $column, $active = NULL)
 {
     $referencing = new GroupedSelection($table, $this, $column, $active);
     $referencing->where("{$table}.{$column}", array_keys((array) $this->rows));
     // (array) - is NULL after insert
     return $referencing;
 }
Ejemplo n.º 5
0
 function getReferencingTable($table, $column, $active = NULL, $forceNewInstance = FALSE)
 {
     $referencing =& $this->referencing["{$table}:{$column}"];
     if (!$referencing || $forceNewInstance) {
         $referencing = new GroupedSelection($table, $this, $column);
         $referencing->where("{$table}.{$column}", array_keys((array) $this->rows));
     }
     return $referencing->setActive($active);
 }
Ejemplo n.º 6
0
Selection($table,$this->connection);$referenced->where($table.'.'.$referenced->primary,array_keys($keys));}else{$referenced=array();}}return$referenced;}function
getReferencingTable($table,$column,$active=NULL,$forceNewInstance=FALSE){$referencing=&$this->referencing["$table:$column"];if(!$referencing||$forceNewInstance){$referencing=new
GroupedSelection($table,$this,$column);$referencing->where("$table.$column",array_keys((array)$this->rows));}return$referencing->setActive($active);}function