/**
  * @param string      $property
  * @param null|string $defaultOrder
  *
  * @return $this
  * @throws \Exception
  */
 public function addOrderProperty($property, $defaultOrder = null)
 {
     if (!is_null($defaultOrder)) {
         $defaultOrder = strtolower($defaultOrder);
         if ($defaultOrder != 'asc' && $defaultOrder != 'desc') {
             throw new \Exception('DefaultOrder needs to be null or asc/desc.');
         }
     }
     $this->orderProperties[StringHelper::snake($property)] = array($property, $defaultOrder);
     return $this;
 }
 /**
  * @param string                  $property
  * @param SearchPropertyInterface $searchProperty
  * @param string                  $propertyAlias
  *
  * @return $this
  */
 public function addSearchProperty($property, SearchPropertyInterface $searchProperty, $propertyAlias = null)
 {
     $this->searchProperties[StringHelper::snake($property)] = array($property, $searchProperty, $propertyAlias);
     return $this;
 }