getSettingCriteria() public method

Gets filter criteria by the setting
public getSettingCriteria ( string $name, string $value = null, array $criteria = null ) : array
$name string Setting name
$value string optional Setting value
$criteria array optional Criteria, if already exists
return array Returns extended criteria
Esempio n. 1
0
 protected function _launchedBy($from, $to, $action)
 {
     switch ($action) {
         case static::ACT_CONVERT_TO_OBJECT:
             /* @var $from Server */
             $to->launchedBy = ['id' => $from->properties[Server::LAUNCHED_BY_ID]];
             break;
         case static::ACT_CONVERT_TO_ENTITY:
             /* @var $to Server */
             $launchedBy = ApiController::getBareId($from, 'launchedBy');
             if (!isset($launchedBy)) {
                 throw new ApiErrorException(400, ErrorMessage::ERR_INVALID_STRUCTURE, "Missed launchedBy.id property");
             }
             $to->properties[Server::LAUNCHED_BY_ID] = $launchedBy;
             break;
         case static::ACT_GET_FILTER_CRITERIA:
             $entity = new Server();
             return $entity->getSettingCriteria(Server::LAUNCHED_BY_ID, ApiController::getBareId($from, 'launchedBy'));
     }
 }