FluidTYPO3\Vhs\ViewHelpers\Iterator\SortViewHelper::getSortValue PHP 메소드

getSortValue() 보호된 메소드

Gets the value to use as sorting value from $object
protected getSortValue ( mixed $object ) : mixed
$object mixed
리턴 mixed
    protected function getSortValue($object)
    {
        $field = $this->arguments['sortBy'];
        $value = ObjectAccess::getPropertyPath($object, $field);
        if (true === $value instanceof \DateTime) {
            $value = intval($value->format('U'));
        } elseif (true === $value instanceof ObjectStorage || true === $value instanceof LazyObjectStorage) {
            $value = $value->count();
        } elseif (is_array($value)) {
            $value = count($value);
        }
        return $value;
    }