Mongolid\DataMapper\EntityAssembler::morphingTime PHP Метод

morphingTime() защищенный Метод

Returns the return of polymorph method of the given entity if available.
См. также: Mongolid\Model\PolymorphableInterface::polymorph
См. также: https://i.ytimg.com/vi/TFGN9kAjdis/maxresdefault.jpg
protected morphingTime ( mixed $entity ) : mixed
$entity mixed The entity that may or may not have a polymorph method.
Результат mixed The result of $entity->polymorph or the $entity itself.
    protected function morphingTime($entity)
    {
        if ($entity instanceof PolymorphableInterface) {
            return $entity->polymorph();
        }
        return $entity;
    }