LeanMapper\Entity::getValueByPropertyWithRelationship PHP Method

getValueByPropertyWithRelationship() protected method

protected getValueByPropertyWithRelationship ( Property | string $property, Filtering $targetTableFiltering = null, Filtering $relationshipTableFiltering = null ) : Entity | Entity[]
$property LeanMapper\Reflection\Property | string micro-optimalization
$targetTableFiltering Filtering
$relationshipTableFiltering Filtering
return Entity | Entity[]
    protected function getValueByPropertyWithRelationship($property, Filtering $targetTableFiltering = null, Filtering $relationshipTableFiltering = null)
    {
        if (is_string($property)) {
            $property = $this->getCurrentReflection()->getEntityProperty($property);
        }
        $relationship = $property->getRelationship();
        $method = explode('\\', get_class($relationship));
        $method = 'get' . end($method) . 'Value';
        try {
            return $this->{$method}($property, $relationship, $targetTableFiltering, $relationshipTableFiltering);
        } catch (Exception $e) {
            throw new LeanMapperException("Cannot get value of property '{$property->getName()}' in entity " . get_called_class() . ' due to low-level failure: ' . $e->getMessage(), $e->getCode(), $e);
        }
    }