/** * 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; }
/** * Check to see if there is a many-to-many relationship with the supplied * name. * * @param string $name * @return boolean */ public function has($name) { return $this->table->hasManyToManyRelationship($name); }