本文整理汇总了PHP中Core::normalize_args方法的典型用法代码示例。如果您正苦于以下问题:PHP Core::normalize_args方法的具体用法?PHP Core::normalize_args怎么用?PHP Core::normalize_args使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core
的用法示例。
在下文中一共展示了Core::normalize_args方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mappers
/**
* Устанавливает набор мапперов
*
* @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;
}
示例2: use_helpers
/**
* Регестрирует хелпер
*
*/
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);
}
}
}
示例3: register
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;
}
示例4: __construct
/**
*/
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);
}
}
}
示例5: filter
public function filter()
{
foreach (Core::normalize_args(func_get_args()) as $arg) {
$this->filters[str_replace('!', '', $arg)] = !Core_Strings::starts_with($arg, '!');
}
return $this;
}
示例6: concat_with
/**
* Объединяет строки с использованием разделителя
*
* @return string
*/
public static function concat_with()
{
$args = Core::normalize_args(func_get_args());
return implode((string) array_shift($args), $args);
}
示例7: __call
/**
* Выполняет диспетчеризацию вызово динамических методов.
*
* Метод обрабатывает вызовы методов установки опций маппера.
* С деталями можно ознакомиться в описаниях соответствующих методов.
*
* @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);
}
}
示例8: requests
/**
* @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;
}
示例9: join
/**
* @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;
}
示例10: delete_tags
/**
* @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;
}
示例11: __construct
/**
* Конструктор
*
* @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);
}
示例12: range
/**
* @return Service_Google_Chart_Axis
*/
public function range()
{
$args = func_get_args();
return $this->option('chxr', Core::normalize_args($args));
}
示例13: produces
/**
* @return WS_REST_Method
*/
public function produces()
{
foreach (Core::normalize_args(func_get_args()) as $format) {
$this->formats[] = trim((string) $format);
}
return $this;
}
示例14: PasswordEncoder
/**
* Создает и сохраняет экземпляр класса кодировщика паролей
*
* Используется класс из опции 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);
}
示例15: use_helpers
/**
* Регистрирует хелперы для данного шаблона
*
* @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;
}