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;
}