Example #1
0
 /**
  * Add the EAV values for all attributes to the provided Select.
  *
  * @param Select $select
  * @return Select
  */
 public function augmentSelect(Select $select)
 {
     if ($this->table->hasEav()) {
         $this->table->getEav()->augmentSelect($select);
     }
     return $select;
 }
Example #2
0
 /**
  * Get the value of the specified column.
  *
  * @param string $name
  * @return mixed
  * @throws Exception
  */
 public function get($name)
 {
     if (!in_array($name, $this->columns)) {
         throw new Exception("Getting value of invalid  column \"{$name}\"");
     }
     if ($this->table->hasManyToManyRelationship($name) && !in_array($name, $this->virtualFieldsInitialized) && !isset($this->data[$name])) {
         $relationship = $this->table->getManyToManyRelationship($name);
         $this->virtualFieldsInitialized[] = $name;
         $this->data[$name] = $relationship->loadInitialValue($this);
     }
     if ($this->table->hasEav() && $this->table->getEav()->hasAttribute($name) && !in_array($name, $this->virtualFieldsInitialized)) {
         $this->virtualFieldsInitialized[] = $name;
         $this->data[$name] = $this->table->getEav()->loadInitialValue($this, $name);
     }
     return isset($this->data[$name]) ? $this->data[$name] : null;
 }