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


PHP object::all方法代码示例

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


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

示例1: transformPaginator

 /**
  * Transform Pagination.
  *
  * @return array
  */
 private function transformPaginator()
 {
     $results = array_map(function ($object) {
         return $this->transformation($object, false);
     }, $this->object->all());
     return array_merge(['data' => $results], $this->getPaginationMeta());
 }
开发者ID:askedio,项目名称:laravel-cruddy,代码行数:12,代码来源:ApiTransformer.php

示例2: getSubscriptions

 protected function getSubscriptions($userId)
 {
     // if user explicitly passed, we will return that only
     if (!is_null($userId)) {
         return [$this->subscriptionRepo->subscription($userId)];
     }
     return $this->subscriptionRepo->all();
 }
开发者ID:owlgrin,项目名称:throttle,代码行数:8,代码来源:SeedDailyBaseUsageCommand.php

示例3: cropImage

 /**
  * Description
  * @param object $request
  * @param string $destino
  * @return array
  */
 public function cropImage($request, $destino)
 {
     $data = $request->all();
     if ($request->hasFile('avatar')) {
         $novoNome = date('d-m-Y-h-i-s') . '-' . $request->file('avatar')->getClientOriginalName();
         if ($data['x1'] !== '' && $data['x2'] !== '' && $data['y1'] !== '' && $data['y2'] !== '') {
             $w = $data['x2'] - $data['x1'];
             $h = $data['y2'] - $data['y1'];
             $x = $data['x1'];
             $y = $data['y1'];
             Image::configure(array('driver' => 'gd'));
             $image = Image::make($request->file('avatar'));
             // width, height, $x, $y
             $image->crop($w, $h, $x, $y);
             $image->save($destino . $novoNome);
         } else {
             $image = Image::make($request->file('avatar'));
             $image->save($destino . $novoNome);
         }
         $data["avatar"] = $novoNome;
     }
     unset($data['_token']);
     unset($data['x1']);
     unset($data['y1']);
     unset($data['x2']);
     unset($data['y2']);
     return $data;
 }
开发者ID:EnnioSimoes,项目名称:arquivo-dev,代码行数:34,代码来源:UserService.php

示例4: bulk_actions_categories

 /**
  * Add bulk actions
  *
  * @return array
  **/
 public function bulk_actions_categories()
 {
     $output = '<select name="plugin_category_select" id="bulk-action-selector-category" style="display:none">';
     foreach ((array) $this->category->all() as $category) {
         $output .= '<option value="' . $category->id . '">' . $category->name . '</option>';
     }
     $output .= '</select>';
     echo $output;
 }
开发者ID:jewel-theme,项目名称:plugin-categories,代码行数:14,代码来源:class.controller.php

示例5: getAllFromDatabase

 /**
  * @return array
  */
 private function getAllFromDatabase()
 {
     if ($this->config->get('use_database')) {
         $database_ips = $this->model->all();
         return $database_ips;
     } else {
         $database_ips = $this->toCollection(array());
         return $database_ips;
     }
 }
开发者ID:Rahul-Giri,项目名称:firewall,代码行数:13,代码来源:Firewall.php

示例6: clear

 /**
  * Clears the session
  *
  * Either clears the entire session, or by prefix
  */
 protected function clear()
 {
     if ($this->prefix) {
         foreach ($this->session->all() as $s => $v) {
             if (strpos($s, $this->prefix) === 0) {
                 $this->remove($s);
             }
         }
     } else {
         $this->session->clear();
     }
 }
开发者ID:dehare,项目名称:silex-basics,代码行数:17,代码来源:SessionHelper.php

示例7: getArrayObjectValue

 /**
  * Get an array of collection values.
  *
  * @param  object  $value
  * @return array
  */
 protected function getArrayObjectValue($value)
 {
     return $value->all();
 }
开发者ID:alvarobfdev,项目名称:LaravelCore,代码行数:10,代码来源:IlluminateCollectionPresenter.php

示例8: Exception

<?php

if (!hasRight('displayview', true)) {
    throw new Exception('{{401 - Accès non autorisé}}');
}
$nbEqlogic = 0;
$nbCmd = 0;
$objects = object::all();
$eqLogics = array();
$cmds = array();
$eqLogics[-1] = eqLogic::byObjectId(null, false);
foreach ($eqLogics[-1] as $eqLogic) {
    $cmds[$eqLogic->getId()] = $eqLogic->getCmd();
    $nbCmd += count($cmds[$eqLogic->getId()]);
}
$nbEqlogic += count($eqLogics[-1]);
foreach ($objects as $object) {
    $eqLogics[$object->getId()] = $object->getEqLogic(false, false);
    foreach ($eqLogics[$object->getId()] as $eqLogic) {
        $cmds[$eqLogic->getId()] = $eqLogic->getCmd();
        $nbCmd += count($cmds[$eqLogic->getId()]);
    }
    $nbEqlogic += count($eqLogics[$object->getId()]);
}
?>
<style>
	.eqLogicSortable{
		list-style-type: none;
		min-height: 20px;
		padding-left: 0px;
	}
开发者ID:saez0pub,项目名称:core,代码行数:31,代码来源:display.php

示例9: all

 public function all()
 {
     return $this->model->all();
 }
开发者ID:iscnorena,项目名称:report,代码行数:4,代码来源:BaseRepo.php

示例10: changeMode

 public static function changeMode($_mode)
 {
     switch ($_mode) {
         case 'master':
             if (config::byKey('jeeNetwork::mode') != 'master') {
                 $cron = new cron();
                 $cron->setClass('history');
                 $cron->setFunction('historize');
                 $cron->setSchedule('*/5 * * * * *');
                 $cron->setTimeout(5);
                 $cron->save();
                 $cron = new cron();
                 $cron->setClass('scenario');
                 $cron->setFunction('check');
                 $cron->setSchedule('* * * * * *');
                 $cron->setTimeout(5);
                 $cron->save();
                 $cron = new cron();
                 $cron->setClass('cmd');
                 $cron->setFunction('collect');
                 $cron->setSchedule('*/5 * * * * *');
                 $cron->setTimeout(5);
                 $cron->save();
                 $cron = new cron();
                 $cron->setClass('history');
                 $cron->setFunction('archive');
                 $cron->setSchedule('00 * * * * *');
                 $cron->setTimeout(20);
                 $cron->save();
                 config::save('jeeNetwork::mode', 'master');
             }
             break;
         case 'slave':
             if (config::byKey('jeeNetwork::mode') != 'slave') {
                 foreach (eqLogic::all() as $eqLogic) {
                     $eqLogic->remove();
                 }
                 foreach (object::all() as $object) {
                     $object->remove();
                 }
                 foreach (update::all() as $update) {
                     switch ($update->getType()) {
                         case 'core':
                             break;
                         case 'plugin':
                             try {
                                 $plugin = plugin::byId($update->getLogicalId());
                                 if (is_object($plugin) && $plugin->getAllowRemote() != 1) {
                                     $update->deleteObjet();
                                 }
                             } catch (Exception $e) {
                             }
                             break;
                         default:
                             $update->deleteObjet();
                             break;
                     }
                 }
                 foreach (view::all() as $view) {
                     $view->remove();
                 }
                 foreach (plan::all() as $plan) {
                     $plan->remove();
                 }
                 foreach (scenario::all() as $scenario) {
                     $scenario->remove();
                 }
                 foreach (listener::all() as $listener) {
                     $listener->remove();
                 }
                 $cron = cron::byClassAndFunction('history', 'historize');
                 if (is_object($cron)) {
                     $cron->remove();
                 }
                 $cron = cron::byClassAndFunction('scenario', 'check');
                 if (is_object($cron)) {
                     $cron->remove();
                 }
                 $cron = cron::byClassAndFunction('cmd', 'collect');
                 if (is_object($cron)) {
                     $cron->remove();
                 }
                 $cron = cron::byClassAndFunction('history', 'archive');
                 if (is_object($cron)) {
                     $cron->remove();
                 }
                 $user = new user();
                 $user->setLogin('jeedom_master');
                 $user->setPassword(config::genKey(255));
                 $user->setRights('admin', 1);
                 $user->save();
                 config::save('jeeNetwork::mode', 'slave');
             }
             break;
     }
 }
开发者ID:GaelGRIFFON,项目名称:core,代码行数:96,代码来源:jeeNetwork.class.php

示例11: all

 /**
  * Calls the model controller's all method to returns all records in a table,
  * defaulting the modeled table name.
  *
  * @param string $orderby Fields for the ORDER BY clause.
  * @param int $count Number of records to return.  null = all
  * @param int $start Index of first record to return.  null = 0
  * @param string $indexby (NOT YET IMPLEMENTED)
  * @return object An handler instance of result_class for query results.
  */
 public function all($orderby = null, $count = null, $start = null, $indexby = null)
 {
     return $this->model->all($this->table_name, $orderby, $count, $start, $indexby);
 }
开发者ID:ericpridham,项目名称:site,代码行数:14,代码来源:db.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $input = $this->request->all();
     $experiences = $this->products->fetchAll('mobile', ['events, experiences'], $input);
     return response()->json($experiences['data'], $experiences['code']);
 }
开发者ID:Charu91,项目名称:Wowtables1,代码行数:11,代码来源:ExperiencesController.php

示例13: all

 /**
  * All - gets all the values from the param bag
  *
  * @return array
  * @author Dan Cox
  */
 public static function all()
 {
     return static::$parameterBag->all();
 }
开发者ID:Danzabar,项目名称:schedules,代码行数:10,代码来源:Input.php

示例14: fullData

 public static function fullData($_restrict = array())
 {
     $return = array();
     foreach (object::all(true) as $object) {
         if (!is_array($_restrict['object']) || isset($_restrict['object'][$object->getId()])) {
             $object_return = utils::o2a($object);
             $object_return['eqLogics'] = array();
             foreach ($object->getEqLogic(true, true) as $eqLogic) {
                 if (!isset($_restrict['eqLogic']) || !is_array($_restrict['eqLogic']) || isset($_restrict['eqLogic'][$eqLogic->getId()])) {
                     $eqLogic_return = utils::o2a($eqLogic);
                     $eqLogic_return['cmds'] = array();
                     foreach ($eqLogic->getCmd() as $cmd) {
                         if (!isset($_restrict['cmd']) || !is_array($_restrict['cmd']) || isset($_restrict['cmd'][$cmd->getId()])) {
                             $cmd_return = utils::o2a($cmd);
                             if ($cmd->getType() == 'info') {
                                 $cmd_return['state'] = $cmd->execCmd(null, 2);
                             }
                             $eqLogic_return['cmds'][] = $cmd_return;
                         }
                     }
                     $object_return['eqLogics'][] = $eqLogic_return;
                 }
             }
             $return[] = $object_return;
         }
     }
     cache::set('api::object::full', json_encode($return), 0);
     return $return;
 }
开发者ID:GaelGRIFFON,项目名称:core,代码行数:29,代码来源:object.class.php

示例15: whatDoYouKnow

 public static function whatDoYouKnow($_object = null)
 {
     $result = array();
     if (is_object($_object)) {
         $objects = array($_object);
     } else {
         $objects = object::all();
     }
     foreach ($objects as $object) {
         foreach ($object->getEqLogic() as $eqLogic) {
             if ($eqLogic->getIsEnable() == 1) {
                 foreach ($eqLogic->getCmd() as $cmd) {
                     if ($cmd->getIsVisible() == 1 && $cmd->getType() == 'info') {
                         try {
                             $value = $cmd->execCmd();
                             if (!isset($result[$object->getId()])) {
                                 $result[$object->getId()] = array();
                                 $result[$object->getId()]['name'] = $object->getName();
                                 $result[$object->getId()]['eqLogic'] = array();
                             }
                             if (!isset($result[$object->getId()]['eqLogic'][$eqLogic->getId()])) {
                                 $result[$object->getId()]['eqLogic'][$eqLogic->getId()] = array();
                                 $result[$object->getId()]['eqLogic'][$eqLogic->getId()]['name'] = $eqLogic->getName();
                                 $result[$object->getId()]['eqLogic'][$eqLogic->getId()]['cmd'] = array();
                             }
                             $result[$object->getId()]['eqLogic'][$eqLogic->getId()]['cmd'][$cmd->getId()] = array();
                             $result[$object->getId()]['eqLogic'][$eqLogic->getId()]['cmd'][$cmd->getId()]['name'] = $cmd->getName();
                             $result[$object->getId()]['eqLogic'][$eqLogic->getId()]['cmd'][$cmd->getId()]['unite'] = $cmd->getUnite();
                             $result[$object->getId()]['eqLogic'][$eqLogic->getId()]['cmd'][$cmd->getId()]['value'] = $value;
                         } catch (Exception $exc) {
                         }
                     }
                 }
             }
         }
     }
     return $result;
 }
开发者ID:GaelGRIFFON,项目名称:core,代码行数:38,代码来源:jeedom.class.php


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