Get a column by its property name, or null if no such column exists
public getColumnByProperty ( $name ) : |
||
$name | ||
Результат |
/** * Get the value of a property on the entity * * @param string $name * @return mixed */ public function getPropertyValue($name) { if ($column = $this->metadata->getColumnByProperty($name)) { $getter = $column->getGetter(); return $this->entity->{$getter}(); } elseif ($relationship = $this->metadata->getRelationshipByName($name)) { $getter = $relationship->getGetter(); return $this->entity->{$getter}(); } else { throw new InvalidArgumentException("No column/relationship found for property '" . $name . "'"); } }