/** * Устанавливает набор мапперов * * @return Search_Sphinx_ORM_Resolver */ public function mappers() { foreach (Core::normalize_args(func_get_args()) as $k => $mapper) { if ($mapper instanceof DB_ORM_Mapper) { $this->mappers[$k] = $mapper; } } return $this; }
/** * Регестрирует хелпер * */ public static function use_helpers() { $args = Core::normalize_args(func_get_args()); foreach ($args as $k => $v) { if ($v instanceof Templates_HelperInterface) { self::$helpers->append($v, is_numeric($k) ? null : (string) $k); } } }
public function register() { $args = func_get_args(); foreach (Core::normalize_args($args) as $name => $call) { if ($call instanceof Core_InvokeInterface) { $this->register[$this->standartizate_name($name)] = $call; } } return $this; }
/** */ public function __construct() { $arg = Core::normalize_args(func_get_args()); $this->checkers = array(); if ($arg != null) { foreach ($arg as $k => $v) { $this->add_checker($v); } } }
public function filter() { foreach (Core::normalize_args(func_get_args()) as $arg) { $this->filters[str_replace('!', '', $arg)] = !Core_Strings::starts_with($arg, '!'); } return $this; }
/** * Объединяет строки с использованием разделителя * * @return string */ public static function concat_with() { $args = Core::normalize_args(func_get_args()); return implode((string) array_shift($args), $args); }
/** * Выполняет диспетчеризацию вызово динамических методов. * * Метод обрабатывает вызовы методов установки опций маппера. * С деталями можно ознакомиться в описаниях соответствующих методов. * * @param string $method имя метода * @param mixed $args аргументы метода * * @return self */ public function __call($method, $args) { switch ($method) { case 'classname': case 'column': case 'validator': case 'table': case 'calculate': case 'explicit_key': case 'lookup_by': case 'search_by': case 'index': case 'defaults': $this->options->__call($method, $args); return $this; case 'order_by': case 'group_by': case 'range': if ($this->is_immutable) { return $this->spawn()->__call($method, $args); } else { $this->options->__call($method, $args); return $this; } case 'key': case 'columns': $this->options->{$method}(Core::normalize_args($args)); return $this; case 'only': case 'exclude': if ($this->is_immutable) { return $this->spawn()->__call($method, $args); } else { $this->options->{$method}(Core::normalize_args($args)); return $this; } case 'having': case 'where': if ($this->is_immutable) { return $this->spawn()->__call($method, $args); } $expr = isset($args[0]) ? $args[0] : null; $parms = isset($args[1]) ? $args[1] : null; if (is_array($expr)) { $expr = '(' . implode(') AND (', $expr) . ')'; } if ($parms !== null) { $this->collect_binds($expr, $parms); } $this->options->{$method}($expr); return $this; case 'join': if ($this->is_immutable) { return $this->spawn()->__call($method, $args); } $type = array_shift($args); $table = array_shift($args); $this->options->{$method}($type, $table, Core::normalize_args($args)); return $this; default: return parent::__call($method, $args); } }
/** * @param array $values * * @return OpenSocial_Client */ public function requests() { foreach (Core::normalize_args(func_get_args()) as $id => $request) { $this->request($request, is_int($id) ? null : $id); } return $this; }
/** * @param string $type * @param string $table * * @return DB_ORM_SelectStatement */ public function join($type, $table) { $this->make_part('joins'); $this->parts['joins'][] = array($type, $table, Core::normalize_args(array_splice(func_get_args(), 2))); return $this; }
/** * @return boolean */ public function delete_tags() { $args = func_get_args(); $tags = Core::normalize_args($args); $res = true; foreach ($tags as $t) { $tag_key = Cache_Tagged::option('tag_prefix') . $t; $keys = $this->backend->get($tag_key); if (is_array($keys)) { foreach ($keys as $key) { $res && $this->backend->delete($key); } } $res = $res && $this->backend->delete($tag_key); } return $res; }
/** * Конструктор * * @param WS_ServiceInterface $application */ public function __construct(WS_ServiceInterface $application) { $args = func_get_args(); parent::__construct(array_shift($args)); $this->args = Core::normalize_args($args); }
/** * @return Service_Google_Chart_Axis */ public function range() { $args = func_get_args(); return $this->option('chxr', Core::normalize_args($args)); }
/** * @return WS_REST_Method */ public function produces() { foreach (Core::normalize_args(func_get_args()) as $format) { $this->formats[] = trim((string) $format); } return $this; }
/** * Создает и сохраняет экземпляр класса кодировщика паролей * * Используется класс из опции password_encoder_class. * В конструктор передается соль из опции password_salt */ public static function PasswordEncoder() { if (!is_null(self::$encoder)) { return self::$encoder; } $args = Core::normalize_args(func_get_args()); $salt = self::option('password_salt'); if (!empty($salt) && (!isset($args[0]) || empty($args[0]))) { $args[0] = $salt; } $class = self::option('password_encoder_class'); if (!is_null(self::option('password_encoder_callback'))) { $class = 'Digest.PasswordCallbackEncoder'; $salt = isset($args[0]) ? $args[0] : null; $args[0] = self::option('password_encoder_callback'); $args[1] = $salt; } return self::$encoder = Core::amake($class, $args); }
/** * Регистрирует хелперы для данного шаблона * * @return Templates_Templates */ public function use_helpers() { $args = Core::normalize_args(func_get_args()); if (count($args) > 0) { foreach ($args as $k => $v) { if ($v instanceof Templates_HelperInterface) { $this->helpers->append($v, $k); } } } return $this; }
/** * @return Service…Yandex_Direct_ForecastBuilder */ public function with_categories() { $args = func_get_args(); return $this->update_attrs('Categories', Core::normalize_args($args)); }
public function use_scripts() { foreach (Core::normalize_args(func_get_args()) as $file) { $this->use_file(is_array($file) ? $file : array('name' => $file), 'js'); } return $this; }