createPropertyComparator() public static method

Creates a comparator for properties
public static createPropertyComparator ( string $type ) : phootwork\lang\Comparator
$type string
return phootwork\lang\Comparator
Ejemplo n.º 1
0
 private function sortProperties(PropertiesInterface $model)
 {
     if ($this->config->isSortingEnabled() && ($propertySorting = $this->config->getPropertySorting()) !== false) {
         if (is_string($propertySorting)) {
             $propertySorting = ComparatorFactory::createPropertyComparator($propertySorting);
         }
         $model->getProperties()->sort($propertySorting);
     }
 }