src/mako/database/midgard/ORM.php
public function getValue(string $name)
	{
		if(array_key_exists($name, $this->columns))
		{
			// It's a database column

			return $this->getColumnValue($name);
		}
		elseif(array_key_exists($name, $this->related))
		{
			// The column is a cached or eagerly loaded relation

			return $this->related[$name];
		}
		elseif($this->isRelation($name))
		{
			// The column is a relation. Lazy load the record(s) and cache them

			return $this->related[$name] = $this->$name()->getRelated();
		}

		// All options have been exhausted so we'll throw an exception

		throw new RuntimeException(vsprintf('Unknown column or relation [ %s ].', [$name]));
	}
public function getValue(string $name)
	{
		if(array_key_exists($name, $this->columns))
		{
			// It's a database column

			return $this->getColumnValue($name);
		}
		elseif(array_key_exists($name, $this->related))
		{
			// The column is a cached or eagerly loaded relation

			return $this->related[$name];
		}
		elseif($this->isRelation($name))
		{
			// The column is a relation. Lazy load the record(s) and cache them

			return $this->related[$name] = $this->$name()->getRelated();
		}

		// All options have been exhausted so we'll throw an exception

		throw new RuntimeException(vsprintf('Unknown column or relation [ %s ].', [$name]));
	}
public function getValue ( string $ name ) { if ( array_key_exists ( $ name , $ this -> columns ) ) { // It's a database column return $ this -> getColumnValue ( $ name ) ; } elseif ( array_key_exists ( $ name , $ this -> related ) ) { // The column is a cached or eagerly loaded relation return $ this -> related [ $ name ] ; } elseif ( $ this -> isRelation ( $ name ) ) { // The column is a relation. Lazy load the record(s) and cache them return $ this -> related [ $ name ] = $ this -> $ name ( ) -> getRelated ( ) ; } // All options have been exhausted so we'll throw an exception throw new RuntimeException ( vsprintf ( 'Unknown column or relation [ %s ].' , [ $ name ] ) ) ; }
Gets a column value or relation.

@param  string            $name Column name
@throws \RuntimeException
@return mixed
Gets a column value or relation .