当前位置: 首页>>代码示例>>PHP>>正文


PHP Fluent::get方法代码示例

本文整理汇总了PHP中Illuminate\Support\Fluent::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Fluent::get方法的具体用法?PHP Fluent::get怎么用?PHP Fluent::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Fluent的用法示例。


在下文中一共展示了Fluent::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deactivate

 /**
  * Deactivate an extension.
  *
  * @param  \Orchestra\Contracts\Extension\Listener\Deactivator  $listener
  * @param  \Illuminate\Support\Fluent  $extension
  *
  * @return mixed
  */
 public function deactivate(Listener $listener, Fluent $extension)
 {
     if (!$this->factory->started($extension->get('name')) && !$this->factory->activated($extension->get('name'))) {
         return $listener->abortWhenRequirementMismatched();
     }
     $this->factory->deactivate($extension->get('name'));
     return $listener->deactivationHasSucceed($extension);
 }
开发者ID:jitheshgopan,项目名称:extension,代码行数:16,代码来源:Deactivator.php

示例2: isEmptyDir

 /**
  * Determing if it is just an empty directory
  *
  * @return bool
  */
 public function isEmptyDir()
 {
     $emptyDir = $this->ingredient->get('empty-dir');
     if (is_null($emptyDir)) {
         return false;
     }
     return $emptyDir;
 }
开发者ID:elepunk,项目名称:oven,代码行数:13,代码来源:Ingredient.php

示例3: get

 public function get($key, $default = null)
 {
     if ($key === 'date') {
         return $this->dateTime();
     }
     return parent::get($key, $default);
 }
开发者ID:lud,项目名称:press,代码行数:7,代码来源:MetaWrapper.php

示例4: migrate

 /**
  * Update/migrate an extension.
  *
  * @param  \Orchestra\Contracts\Extension\Listener\Migrator  $listener
  * @param  \Illuminate\Support\Fluent  $extension
  *
  * @return mixed
  */
 public function migrate(Listener $listener, Fluent $extension)
 {
     if (!$this->factory->started($extension->get('name'))) {
         return $listener->abortWhenRequirementMismatched();
     }
     return $this->execute($listener, 'migration', $extension, $this->getMigrationClosure());
 }
开发者ID:jitheshgopan,项目名称:extension,代码行数:15,代码来源:Migrator.php

示例5: __get

 /**
  * Magic method to get items by key.
  *
  * @param  string  $key
  *
  * @return mixed
  */
 public function __get($key)
 {
     if (!isset($this->items->{$key})) {
         return;
     }
     return $this->items->get($key);
 }
开发者ID:wendel841,项目名称:view,代码行数:14,代码来源:Manifest.php

示例6: verifyExpression

 /**
  * Vaildate if expression contains the reserve keys
  *
  * @param  array $expression
  * @return boolean
  * @throws  \Elepunk\Evaluator\Exceptions\MissingKeyException
  */
 protected function verifyExpression(Fluent $expression)
 {
     foreach ($this->reservedKeys as $key) {
         if (is_null($expression->get($key))) {
             throw new MissingKeyException("Expression is missing {$key}");
         }
     }
     return true;
 }
开发者ID:elepunk,项目名称:evaluator,代码行数:16,代码来源:ExpressionCheckerTrait.php

示例7: execute

 /**
  * Execute extension processing.
  *
  * @param  object  $listener
  * @param  string  $type
  * @param  \Illuminate\Support\Fluent  $extension
  * @param  \Closure  $callback
  *
  * @return mixed
  */
 protected function execute($listener, $type, Fluent $extension, Closure $callback)
 {
     $name = $extension->get('name');
     try {
         // Check if folder is writable via the web instance, this would
         // avoid issue running Orchestra Platform with debug as true where
         // creating/copying the directory would throw an ErrorException.
         if (!$this->factory->permission($name)) {
             throw new FilePermissionException("[{$name}] is not writable.");
         }
         call_user_func($callback, $this->factory, $name);
     } catch (FilePermissionException $e) {
         return call_user_func([$listener, "{$type}HasFailed"], $extension, ['error' => $e->getMessage()]);
     }
     return call_user_func([$listener, "{$type}HasSucceed"], $extension);
 }
开发者ID:jitheshgopan,项目名称:extension,代码行数:26,代码来源:Processor.php

示例8: update

 /**
  * Update an extension configuration.
  *
  * @param  \Orchestra\Contracts\Extension\Listener\Configure  $listener
  * @param  \Illuminate\Support\Fluent  $extension
  * @param  array  $input
  *
  * @return mixed
  */
 public function update(Listener $listener, Fluent $extension, array $input)
 {
     if (!Extension::started($extension->get('name'))) {
         return $listener->suspend(404);
     }
     $validation = $this->validator->with($input, ["orchestra.validate: extension.{$extension->get('name')}"]);
     if ($validation->fails()) {
         return $listener->updateConfigurationFailedValidation($validation->getMessageBag(), $extension->uid);
     }
     $memory = Foundation::memory();
     $config = (array) $memory->get("extension.active.{$extension->get('name')}.config", []);
     $input = new Fluent(array_merge($config, $input));
     unset($input['_token']);
     Event::fire("orchestra.saving: extension.{$extension->get('name')}", [&$input]);
     $memory->put("extensions.active.{$extension->get('name')}.config", $input->getAttributes());
     $memory->put("extension_{$extension->get('name')}", $input->getAttributes());
     Event::fire("orchestra.saved: extension.{$extension->get('name')}", [$input]);
     return $listener->configurationUpdated($extension);
 }
开发者ID:stevebauman,项目名称:foundation,代码行数:28,代码来源:Configure.php

示例9: queueToPublisher

 /**
  * Queue publishing asset to publisher.
  *
  * @param  \Illuminate\Support\Fluent  $extension
  *
  * @return mixed
  */
 protected function queueToPublisher(Fluent $extension)
 {
     Publisher::queue($extension->get('name'));
     return $this->redirect(handles('orchestra::publisher'));
 }
开发者ID:stevebauman,项目名称:foundation,代码行数:12,代码来源:ActionController.php

示例10: syncSucceed

 /**
  * Response when sync roles succeed.
  *
  * @param  \Illuminate\Support\Fluent   $acl
  *
  * @return mixed
  */
 public function syncSucceed(Fluent $acl)
 {
     $message = trans('orchestra/control::response.acls.sync-roles', ['name' => $acl->get('name')]);
     return $this->redirectWithMessage(handles("orchestra::control/acl?name={$acl->get('name')}"), $message);
 }
开发者ID:quetzyg,项目名称:control,代码行数:12,代码来源:AuthorizationController.php

示例11: get

 /**
  * @param string $key
  * @param mixed|null $default
  * @return mixed
  */
 public function get($key, $default = null)
 {
     $value = parent::get($key, $default);
     return $this->hasGetMutator($key) ? $this->mutateAttribute($key, $value) : $value;
 }
开发者ID:silwerclaw,项目名称:jirapi,代码行数:10,代码来源:Entity.php

示例12: migrationHasSucceed

 /**
  * Response when extension migration has succeed.
  *
  * @param  \Illuminate\Support\Fluent  $extension
  *
  * @return mixed
  */
 public function migrationHasSucceed(Fluent $extension)
 {
     $this->info("Extension [{$extension->get('name')}] updated.");
 }
开发者ID:jitheshgopan,项目名称:extension,代码行数:11,代码来源:PublishCommand.php

示例13: deactivationHasSucceed

 /**
  * Response when extension deactivation has succeed.
  *
  * @param  \Illuminate\Support\Fluent  $extension
  *
  * @return mixed
  */
 public function deactivationHasSucceed(Fluent $extension)
 {
     $this->refreshRouteCache();
     $this->info("Extension [{$extension->get('name')}] deactivated.");
 }
开发者ID:jitheshgopan,项目名称:extension,代码行数:12,代码来源:DeactivateCommand.php

示例14: resolveFieldValue

 /**
  * Resolve field value.
  *
  * @param  string  $name
  * @param  mixed  $row
  * @param  \Illuminate\Support\Fluent  $control
  *
  * @return mixed
  */
 protected function resolveFieldValue($name, $row, Fluent $control)
 {
     // Set the value from old input, followed by row value.
     $value = $this->request->old($name);
     $model = data_get($row, $name);
     if (!is_null($model) && is_null($value)) {
         $value = $model;
     }
     if (is_null($control->get('value'))) {
         return $value;
     }
     $value = $control->get('value');
     // If the value is set from the closure, we should use it instead of
     // value retrieved from attached data. Should also check if it's a
     // closure, when this happen run it.
     if ($value instanceof Closure) {
         $value = $value($row, $control);
     }
     return $value;
 }
开发者ID:stevebauman,项目名称:html,代码行数:29,代码来源:Control.php

示例15: buildTimestamp

 /**
  * @param $value
  * @param Fluent $ruleArgs
  * @return Carbon
  */
 public function buildTimestamp($value, $ruleArgs)
 {
     if (is_null($value)) {
         return $this->newDateObject();
     }
     if ($value instanceof \DateTime) {
         return $this->newDateFromTimestamp($value->getTimestamp(), $value->getTimezone());
     }
     if (is_numeric($value)) {
         return $this->newDateFromTimestamp($value);
     } elseif (is_string($value) && preg_match('/^(\\d{4})-(\\d{2})-(\\d{2})$/', $value)) {
         return $this->newDateObject($value, 'Y-m-d');
     } else {
         return $this->newDateObject($value, $ruleArgs->get('format'));
     }
 }
开发者ID:iyoworks,项目名称:entity,代码行数:21,代码来源:Transformer.php


注:本文中的Illuminate\Support\Fluent::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。