當前位置: 首頁>>代碼示例>>PHP>>正文


PHP type::toArray方法代碼示例

本文整理匯總了PHP中type::toArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::toArray方法的具體用法?PHP type::toArray怎麽用?PHP type::toArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在type的用法示例。


在下文中一共展示了type::toArray方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: areImagesValid

 public function areImagesValid(ExecutionContext $context)
 {
     $captured_ids = array_map(function ($image) {
         return $image->getId();
     }, $this->images->toArray());
     $property_path = $context->getPropertyPath() . '.images';
     if (!count($captured_ids)) {
         $context->addViolationAt($property_path, 'Please select at least one image!', array(), null);
         return;
     }
     $count = $this->query_builder->andWhere($this->query_builder->expr()->in('i.id', $captured_ids))->select('COUNT(i.id)')->getQuery()->getSingleScalarResult();
     if (!$count) {
         $context->addViolation('Please select images from the list!', array(), null);
     }
 }
開發者ID:rodgermd,項目名稱:mura-show.com,代碼行數:15,代碼來源:BulkImages.php

示例2: saveSettings

 /**
  * 
  * @param type $params
  */
 public static function saveSettings($params)
 {
     $oPlugin = JchPlatformPlugin::getPlugin();
     $oPlugin->params = $params->toArray();
     $oData = new JRegistry($oPlugin);
     $aData = $oData->toArray();
     $oController = new JControllerLegacy();
     $oController->addModelPath(JPATH_ADMINISTRATOR . '/components/com_plugins/models', 'PluginsModel');
     $oPluginModel = $oController->getModel('Plugin', 'PluginsModel');
     if ($oPluginModel->save($aData) === FALSE) {
         JchOptimizeLogger::log(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', $oPluginModel->getError()), $params);
     }
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:17,代碼來源:plugin.php

示例3: streamWMS

 /**
  * Stream WMS tiles for $feature in high resolution
  * or in low resolution if $lowResolution is set to true
  * 
  * @param type $feature
  * @param type $lowResolution
  */
 public function streamWMS($feature, $lowResolution = false)
 {
     /*
      * Easy case - no feature or no WMS
      */
     if (!isset($feature)) {
         RestoLogUtil::httpError(404);
     }
     $featureArray = $feature->toArray();
     if (!isset($featureArray['properties']['wmsInfos'])) {
         RestoLogUtil::httpError(404);
     }
     $this->stream($this->getWMSUrl($featureArray['properties']['wmsInfos'], $lowResolution));
 }
開發者ID:rmourembles,項目名稱:resto,代碼行數:21,代碼來源:RestoWMSUtil.php

示例4: mapNode

 /**
  * Node mapper
  * 
  * @param type $config
  * @return \Core\Plugins\Navigation\Node
  */
 public function mapNode($config)
 {
     $node = new Node();
     $allData = $config->toArray();
     foreach ($allData as $key => $value) {
         if ($key == 'childs') {
             continue;
         }
         $node->{'set' . ucfirst($key)}($value);
     }
     if (isset($config->childs)) {
         $collection = $this->mapCollection($config->childs, $node);
         $node->setChilds($collection);
     }
     return $node;
 }
開發者ID:zedmaster,項目名稱:ticobox,代碼行數:22,代碼來源:Navigation.php

示例5: retrieveDefinitionData

 /**
  * @param $id
  * @return array
  * @codeCoverageIgnore
  */
 public function retrieveDefinitionData($id)
 {
     $this->definitionBean->retrieve($id);
     return $this->definitionBean->toArray();
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:10,代碼來源:PMSEEndSendMessageEvent.php


注:本文中的type::toArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。