本文整理汇总了PHP中forward_static_call_array函数的典型用法代码示例。如果您正苦于以下问题:PHP forward_static_call_array函数的具体用法?PHP forward_static_call_array怎么用?PHP forward_static_call_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了forward_static_call_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findBy
/**
* {@inheritdoc}
* @return Model
*/
public function findBy(array $where = [])
{
if ($where === []) {
return forward_static_call_array([get_class($this->getEloquentModel()), 'all']);
}
return forward_static_call_array([get_class($this->getEloquentModel()), 'where'], $where);
}
示例2: __callStatic
public static function __callStatic($name, $arguments)
{
echo "{$name}(" . implode(', ', $arguments) . ") = ";
$ret = forward_static_call_array($name, $arguments);
echo print_r($ret, true) . "\n";
return $ret;
}
示例3: details
public static function details($_model = null)
{
$module = static::$module;
$modeler = $module::model()->modeler;
$_model = $_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : forward_static_call_array(array($modeler, 'model'), array($_model));
$_o = (object) null;
$_o->size = 'large';
$_o->icon_type = 'menu-icon';
$_o->icon_background = 'atom-icon-background';
$_o->menu = (object) null;
$_o->menu->items = self::modelOperationsMenuItems();
$_o->head = 'Package Details';
$_o->body = array('');
$_o->body[] = (object) array('js' => 'registry.setContext({card:\'cards/package/details\',collection:\'packages\',node:\'' . $_model->id . '\'});');
$_o->body[] = CardKitHTML::sublineBlock('Name');
$_o->body[] = DOMElementKitJS::loadComponentHere(DOMElementKitJS::xhrCallObject('forms/package/name', array($_model->id)), $_model->name, 'settings');
$_o->body[] = CardKitHTML::sublineBlock('Package Sequode');
$_o->body[] = $_model->sequode_id != 0 && \Sequode\Application\Modules\Sequode\Modeler::exists($_model->sequode_id, 'id') ? DOMElementKitJS::loadComponentHere(DOMElementKitJS::xhrCallObject('forms/package/packageSequode', array($_model->id)), \Sequode\Application\Modules\Sequode\Modeler::model()->name, 'settings') : ModuleForm::render(static::$registry_key, 'packageSequode')[0];
$_o->body[] = CardKitHTML::sublineBlock('Package Token');
$_o->body[] = $_model->token;
$_o->body[] = CardKitHTML::sublineBlock('<a target="_blank" href="/source/' . $_model->token . '">Download</a>');
$_o->body[] = CardKit::nextInCollection((object) array('model_id' => $_model->id, 'details_route' => 'cards/package/details'));
if (\Sequode\Application\Modules\Account\Authority::isSystemOwner()) {
$_o->body[] = CardKitHTML::modelId($_model);
}
return $_o;
}
示例4: instance
/**
* Returns the implementation implementation registered with the Facade.
*
* @return Xaamin\Whatsapi\Contracts\WhatsapiInterface
*/
public static function instance()
{
if (!static::$instance) {
static::$instance = forward_static_call_array(array(get_called_class(), 'create'), func_get_args());
}
return static::$instance;
}
示例5: updateLastSignIn
public static function updateLastSignIn($time = false, $_model = null)
{
$modeler = static::$modeler;
$_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : forward_static_call_array(array($modeler, 'model'), array($_model));
$modeler::model()->updateField($time === false ? time() : $time, 'last_sign_in');
return $modeler::model();
}
示例6: delete
public static function delete($_model = null)
{
$modeler = static::$modeler;
$_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : forward_static_call_array(array($modeler, 'model'), array($_model));
$modeler::model()->delete($modeler::model()->id);
return $modeler::model();
}
示例7: instance
/**
* Returns the Sentry instance registered with the Facade.
*
* @return \Cartalyst\Sentry\Sentry
*/
public static function instance()
{
if (static::$instance === null) {
static::$instance = forward_static_call_array([get_called_class(), 'createSentry'], func_get_args());
}
return static::$instance;
}
示例8: actionWorker
/**
* 处理一个Worker
* @param string $q queue name
*/
public function actionWorker($q = "default")
{
$retried_at = date('Y-m-d H:i:s');
$queue = Yii::createObject(['class' => 'wh\\asynctask\\Queue', 'redis' => $this->module->redis]);
/** @var $identity string */
$identity = $queue->getWorkerIdentity();
$logPath = $this->module->getWorkerLogPath();
FileHelper::createDirectory($logPath);
$currentDate = date('Y-m-d');
FileHelper::createDirectory($logPath . '/' . $currentDate);
$logStderr = "{$logPath}/{$currentDate}/{$q}.stderr.log";
$data = $queue->pop($q);
if (!is_null($data)) {
try {
$queue->setWorkerStart($identity, $data);
$this->setProcessTitle($this->module->id . '/worker ' . $data['class'] . ':run(' . implode(', ', $data['args']) . ')');
forward_static_call_array([$data['class'], 'run'], $data['args']);
} catch (\Exception $e) {
if ($data['retry'] && (!isset($data['retry_count']) || $data['retry_count'] < $this->processMaxRetries)) {
$queue->setStat(false);
$realCommand = sprintf('echo "%s">>%s &', $e->getMessage(), $logStderr);
exec($realCommand);
$queue->setRetry(['retry' => $data['retry'], 'class' => $data['class'], 'args' => $data['args'], 'enqueued_at' => $data['enqueued_at'], 'error_message' => $e->getMessage(), 'failed_at' => date('Y-m-d H:i:s'), 'job_id' => $data['job_id'], 'queue' => $data['queue'], 'retried_at' => isset($data['retried_at']) ? $retried_at : date('Y-m-d H:i:s'), 'retry_count' => isset($data['retry_count']) ? intval($data['retry_count']) + 1 : 0]);
}
}
$queue->setStat();
$queue->setWorkerEnd($identity);
}
}
示例9: updatePassword
public static function updatePassword($password, $_model = null)
{
$modeler = static::$modeler;
$_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : forward_static_call_array(array($modeler, 'model'), array($_model));
$modeler::model()->updateField(Hashes::generateHash($password), 'password');
return $modeler::model();
}
示例10: packageSequode
public static function packageSequode($_model = null, $user_model = null)
{
$module = static::$module;
$modeler = $module::model()->modeler;
$_model = $_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : $_model;
$_user_model = $_user_model == null ? \Sequode\Application\Modules\Account\Modeler::model() : $_user_model;
$_o = (object) null;
$values = $where = array();
$values[] = '{\'value\':\'0\',\'printable\':\'Select Package Sequode\'}';
$sequodes_model = new \Sequode\Application\Modules\Sequode\Modeler::$model();
/*
$where[] = array('field'=>'owner_id','operator'=>'=','value'=>5);
$where[] = array('field'=>'shared','operator'=>'=','value'=>1);
$where[] = array('field'=>'package','operator'=>'=','value'=>1);
$sequodes_model->getAll($where);
foreach( $sequodes_model->all as $object){
$values[] = '{\'value\':\''.$object->id.'\',\'printable\':\''.$object->name.'\'}';
}
*/
$where = array();
$where[] = array('field' => 'owner_id', 'operator' => '=', 'value' => $_user_model->id);
$where[] = array('field' => 'package', 'operator' => '=', 'value' => 1);
$sequodes_model->getAll($where);
foreach ($sequodes_model->all as $object) {
$values[] = '{\'value\':\'' . $object->id . '\',\'printable\':\'' . $object->name . '\'}';
}
FormInputModeler::exists('select', 'name');
$_o->sequode = json_decode(FormInputModeler::model()->component_object);
$_o->sequode->Label = '';
$_o->sequode->Values = '[' . implode(',', $values) . ']';
$_o->sequode->Value = $_model->sequode_id;
$_o->sequode->Value_Key = 'value';
$_o->sequode->Printable_Key = 'printable';
return $_o;
}
示例11: collections
public static function collections($collection = 'collections', $key = null)
{
$module = static::$module;
if ($collection == 'collections' && isset($module::model()->assets->boot_collections)) {
$collections = $module::model()->assets->boot_collections;
echo '{';
echo "\n";
foreach ($collections as $loop_key => $collection) {
if ($loop_key != 0) {
echo ",\n";
}
echo '"' . $collection . '":';
echo self::collections($collection);
}
echo "\n";
echo '}';
return;
}
$modules = ModuleRegistry::modules();
foreach ($modules as $module) {
if (!empty($module::model()->collections)) {
if (isset($collection) && in_array($collection, ApplicationRoutes::routes($module::model()->collections))) {
forward_static_call_array(array($module::model()->collections, ApplicationRoutes::route($module::model()->collections, $collection)), $key != null ? array($key) : array());
return;
}
}
}
return;
}
示例12: dispatch
/**
* Closure metódusok futtatása, vagy controller objektumok példányosítása és action futtatása
*/
public function dispatch($data_array)
{
foreach ($data_array as $key => $value) {
if (isset($value['closure']) && is_callable($value['closure'])) {
call_user_func_array($value['closure'], $value['params']);
} elseif (isset($value['controller'])) {
$this->controller = $value['controller'];
$this->action = $value['action'];
$this->params = $value['named_params'];
$controller_class = $this->controller_namespace . ucfirst($value['controller']);
if (class_exists($controller_class)) {
// first check if is a static method, directly trying to invoke it. if isn't a valid static method, we will try as a normal method invocation.
if (call_user_func_array(array(new $controller_class(), $value['action']), $value['params']) === false) {
// try call the method as an non-static method. (the if does nothing, only avoids the notice)
if (forward_static_call_array(array($controller_class, $value['action']), $value['params']) === false) {
}
}
} else {
throw new \Exception("Error Processing Request");
}
} else {
throw new \Exception("Error Processing Request");
}
}
}
示例13: updateEmail
public static function updateEmail($email, $_model = null)
{
$modeler = static::$modeler;
$_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : forward_static_call_array(array($modeler, 'model'), array($_model));
$modeler::model()->updateField($email, 'email');
return $modeler::model();
}
示例14: updateComponentSettings
public static function updateComponentSettings($type, $member, $input_object, $_model = null)
{
$modeler = static::$modeler;
$kit = static::$kit;
$_model == null ? forward_static_call_array(array($modeler, 'model'), array()) : forward_static_call_array(array($modeler, 'model'), array($_model));
switch ($type) {
case 'input':
case 'property':
$object_member = $type . '_form_object';
break;
default:
return $modeler::model();
}
$form_object = json_decode($modeler::model()->{$object_member});
$component = new \Sequode\Application\Modules\FormInput\Model();
if (!$component->exists($input_object->Component, 'name')) {
$component->exists('str', 'name');
}
$form_object_member = (object) null;
$component_form_object = json_decode($component->component_form_object);
foreach ($component_form_object as $loop_member => $loop_value) {
if (isset($input_object->{$loop_member})) {
$form_object_member->{$loop_member} = $input_object->{$loop_member};
}
}
$form_object->{$member} = $form_object_member;
$modeler::model()->updateField(json_encode($form_object), $object_member);
self::maintenance();
return $modeler::model();
}
示例15: getDispatcher
/**
* Returns the event dispatcher.
*
* @return \Illuminate\Events\Dispatcher
*/
public static function getDispatcher()
{
if (!isset(static::$dispatcher)) {
static::$dispatcher = function_exists('app') ? app(Dispatcher::class) : forward_static_call_array('Illuminate\\Container\\Container::make', [Dispatcher::class]);
}
return static::$dispatcher;
}