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


PHP ArrayUtil::toIntegerArray方法代码示例

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


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

示例1: readFormParameters

 /**
  * @see	\wcf\form\IForm::readFormParameters()
  */
 public function readFormParameters()
 {
     parent::readFormParameters();
     if (isset($_POST['points']) && is_array($_POST['points'])) {
         $this->points = ArrayUtil::toIntegerArray($_POST['points']);
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:10,代码来源:UserActivityPointOptionForm.class.php

示例2: getData

 /**
  * @see	\wcf\system\option\IOptionType::getData()
  */
 public function getData(Option $option, $newValue)
 {
     if (!is_array($newValue)) {
         $newValue = array();
     }
     return implode("\n", ArrayUtil::toIntegerArray($newValue));
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:10,代码来源:AbstractCategoryMultiSelectOptionType.class.php

示例3: getConditions

 /**
  * @see    \wcf\system\search\ISearchableObjectType::getConditions()
  */
 public function getConditions(IForm $form = null)
 {
     $conditionBuilder = new PreparedStatementConditionBuilder();
     // accessible category ids
     if (isset($_POST['filebaseCategoryIDs'])) {
         $this->filebaseCategoryIDs = ArrayUtil::toIntegerArray($_POST['filebaseCategoryIDs']);
     }
     $categoryIDs = FilebaseCategory::getAccessibleCategoryIDs();
     if (!empty($this->filebaseCategoryIDs)) {
         $this->filebaseCategoryIDs = array_intersect($categoryIDs, $this->filebaseCategoryIDs);
     } else {
         $this->filebaseCategoryIDs = $categoryIDs;
     }
     if (empty($this->filebaseCategoryIDs)) {
         throw new PermissionDeniedException();
     }
     $conditionBuilder->add($this->getTableName() . '.entryID IN (SELECT entryID FROM filebase' . WCF_N . '_entry_to_category WHERE categoryID IN (?))', array($this->filebaseCategoryIDs));
     // default conditions
     $conditionBuilder->add($this->getTableName() . '.isDisabled = 0');
     $conditionBuilder->add($this->getTableName() . '.isDeleted = 0');
     // language
     if (FILEBASE_ENABLE_MULTILINGUALISM && LanguageFactory::getInstance()->multilingualismEnabled() && count(WCF::getUser()->getLanguageIDs())) {
         $conditionBuilder->add('(' . $this->getTableName() . '.languageID IN (?) OR ' . $this->getTableName() . '.languageID IS NULL)', array(WCF::getUser()->getLanguageIDs()));
     }
     return $conditionBuilder;
 }
开发者ID:Griborim,项目名称:de.incendium.cms.filebase,代码行数:29,代码来源:EntrySearch.class.php

示例4: readParameters

 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     MessageForm::readParameters();
     if (isset($_REQUEST['categoryIDs']) && is_array($_REQUEST['categoryIDs'])) {
         $this->categoryIDs = ArrayUtil::toIntegerArray($_REQUEST['categoryIDs']);
     }
     // get the news by id
     if (isset($_REQUEST['id'])) {
         $this->entryID = intval($_REQUEST['id']);
     }
     $this->entry = new Entry($this->entryID);
     if (!$this->entry->entryID) {
         throw new IllegalLinkException();
     }
     // check news permissions
     if (!$this->entry->canEdit()) {
         throw new PermissionDeniedException();
     }
     // set attachment object id
     $this->attachmentObjectID = $this->entry->entryID;
     // polls
     if ($this->canCreatePoll()) {
         PollManager::getInstance()->setObject('de.incendium.cms.news.entry', $this->entry->entryID, $this->entry->pollID);
     }
     // get max text length
     $this->maxTextLength = WCF::getSession()->getPermission('user.news.maxTextLength');
 }
开发者ID:Griborim,项目名称:de.incendium.cms.news,代码行数:30,代码来源:NewsEntryEditForm.class.php

示例5: getData

 /**
  * @see	\wcf\system\option\IOptionType::getData()
  */
 public function getData(Option $option, $newValue)
 {
     if (!is_array($newValue)) {
         $newValue = array();
     }
     $newValue = ArrayUtil::toIntegerArray($newValue);
     sort($newValue, SORT_NUMERIC);
     return implode(',', $newValue);
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:12,代码来源:UserGroupsUserGroupOptionType.class.php

示例6: readParameters

	/**
	 * @see	wcf\action\Action::readParameters()
	 */
	public function readParameters() {
		AbstractSecureAction::readParameters();
		
		if (isset($_POST['action'])) $this->action = StringUtil::trim($_POST['action']);
		if (isset($_POST['containerData']) && is_array($_POST['containerData'])) $this->containerData = $_POST['containerData'];
		if (isset($_POST['objectIDs']) && is_array($_POST['objectIDs'])) $this->objectIDs = ArrayUtil::toIntegerArray($_POST['objectIDs']);
		if (isset($_POST['pageClassName'])) $this->pageClassName = StringUtil::trim($_POST['pageClassName']);
		if (isset($_POST['type'])) $this->type = StringUtil::trim($_POST['type']);
	}
开发者ID:0xLeon,项目名称:WCF,代码行数:12,代码来源:ClipboardAction.class.php

示例7: readFormParameters

 /**
  * @see	\wcf\form\IForm::readFormParameters()
  */
 public function readFormParameters()
 {
     parent::readFormParameters();
     if (isset($_POST['enable'])) {
         $this->enable = intval($_POST['enable']);
     }
     if (isset($_POST['languageIDs']) && is_array($_POST['languageIDs'])) {
         $this->languageIDs = ArrayUtil::toIntegerArray($_POST['languageIDs']);
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:13,代码来源:LanguageMultilingualismForm.class.php

示例8: readParameters

 public function readParameters()
 {
     parent::readParameters();
     // polls
     if (MODULE_POLL & WCF::getSession()->getPermission('user.cms.news.canStartPoll')) {
         PollManager::getInstance()->setObject('de.codequake.cms.news', 0);
     }
     if (isset($_REQUEST['categoryIDs']) && is_array($_REQUEST['categoryIDs'])) {
         $this->categoryIDs = ArrayUtil::toIntegerArray($_REQUEST['categoryIDs']);
     }
 }
开发者ID:jacboy,项目名称:Fireball_News,代码行数:11,代码来源:NewsAddForm.class.php

示例9: validate

 /**
  * @see	\wcf\system\option\IOptionType::validate()
  */
 public function validate(Option $option, $newValue)
 {
     if (!is_array($newValue)) {
         $newValue = array();
     }
     $newValue = ArrayUtil::toIntegerArray($newValue);
     foreach ($newValue as $pageID) {
         if (PageCache::getInstance()->getPage($pageID) === null) {
             throw new UserInputException($option->optionName, 'validationFailed');
         }
     }
 }
开发者ID:knzo,项目名称:Fireball,代码行数:15,代码来源:CMSPageMultiSelectOptionType.class.php

示例10: readParameters

 /**
  * @see	\wcf\page\IPage::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['id'])) {
         if (is_array($_REQUEST['id'])) {
             // ?id[]=1337&id[]=9001
             $this->objectIDs = ArrayUtil::toIntegerArray($_REQUEST['id']);
         } else {
             // ?id=1337 or ?id=1337,9001
             $this->objectIDs = ArrayUtil::toIntegerArray(explode(',', $_REQUEST['id']));
         }
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:16,代码来源:AbstractFeedPage.class.php

示例11: readParameters

 /**
  * @see	\wcf\action\IAction::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_POST['interfaceName'])) {
         $this->interfaceName = StringUtil::trim($_POST['interfaceName']);
     }
     if (isset($_POST['objectIDs']) && is_array($_POST['objectIDs'])) {
         $this->objectIDs = ArrayUtil::toIntegerArray($_POST['objectIDs']);
     }
     if (isset($_POST['parameters']) && is_array($_POST['parameters'])) {
         $this->parameters = $_POST['parameters'];
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:16,代码来源:AJAXProxyAction.class.php

示例12: readFormParameters

 /**
  * @see	\wcf\form\IForm::readFormParameters()
  */
 public function readFormParameters()
 {
     parent::readFormParameters();
     if (isset($_POST['selectedPackages']) && is_array($_POST['selectedPackages'])) {
         $selectedPackages = ArrayUtil::toIntegerArray($_POST['selectedPackages']);
         $this->selectedPackages = array_combine($selectedPackages, $selectedPackages);
         if (isset($this->selectedPackages[0])) {
             unset($this->selectedPackages[0]);
         }
     }
     if (isset($_POST['exportCustomValues'])) {
         $this->exportCustomValues = intval($_POST['exportCustomValues']);
     }
     if (isset($_POST['languageID'])) {
         $this->languageID = intval($_POST['languageID']);
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:20,代码来源:LanguageExportForm.class.php

示例13: parseMessage

 /**
  * @see	\wcf\system\message\embedded\object\IMessageEmbeddedObjectHandler::parseMessage()
  */
 public function parseMessage($message)
 {
     $parsedAttachmentIDs = array_unique(ArrayUtil::toIntegerArray(array_merge(self::getFirstParameters($message, 'attach'), self::getTextParameters($message, 'attach'))));
     if (!empty($parsedAttachmentIDs)) {
         $attachmentIDs = array();
         foreach ($parsedAttachmentIDs as $parsedAttachmentID) {
             if ($parsedAttachmentID) {
                 $attachmentIDs[] = $parsedAttachmentID;
             }
         }
         if (!empty($attachmentIDs)) {
             $attachmentList = new AttachmentList();
             $attachmentList->getConditionBuilder()->add("attachment.attachmentID IN (?)", array($attachmentIDs));
             $attachmentList->readObjectIDs();
             return $attachmentList->getObjectIDs();
         }
     }
     return false;
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:22,代码来源:AttachmentMessageEmbeddedObjectHandler.class.php

示例14: validateUpdatePosition

 /**
  * @see	\wcf\data\ISortableAction::validateUpdatePosition()
  */
 public function validateUpdatePosition()
 {
     // validate permissions
     WCF::getSession()->checkPermissions(array('admin.content.dashboard.canEditDashboard'));
     $this->readString('boxType');
     $this->readInteger('objectTypeID');
     // validate box type
     if (!in_array($this->parameters['boxType'], array('content', 'sidebar'))) {
         throw new UserInputException('boxType');
     }
     // validate object type
     $objectType = ObjectTypeCache::getInstance()->getObjectType($this->parameters['objectTypeID']);
     if ($objectType !== null) {
         $objectTypeDefinition = ObjectTypeCache::getInstance()->getDefinitionByName('com.woltlab.wcf.user.dashboardContainer');
         if ($objectTypeDefinition !== null) {
             if ($objectType->definitionID == $objectTypeDefinition->definitionID) {
                 $this->objectType = $objectType;
             }
         }
     }
     if ($this->objectType === null) {
         throw new UserInputException('objectTypeID');
     }
     // read all dashboard boxes of the relevant box type
     $boxList = new DashboardBoxList();
     $boxList->getConditionBuilder()->add("dashboard_box.boxType = ?", array($this->parameters['boxType']));
     $boxList->readObjects();
     $this->boxes = $boxList->getObjects();
     // parse structure
     if (isset($this->parameters['data']) & isset($this->parameters['data']['structure']) && isset($this->parameters['data']['structure'][0])) {
         $this->boxStructure = ArrayUtil::toIntegerArray($this->parameters['data']['structure'][0]);
         // validate box ids
         if (!empty($this->boxStructure)) {
             foreach ($this->boxStructure as $boxID) {
                 if (!isset($this->boxes[$boxID])) {
                     throw new UserInputException('boxID');
                 }
             }
         }
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:44,代码来源:DashboardBoxAction.class.php

示例15: parseMessage

 /**
  * @see \wcf\system\message\embedded\object\IMessageEmbeddedObjectHandler::parseMessage()
  */
 public function parseMessage($message)
 {
     // yes i know... but what i can do diffrent to the parent class? ;) I am only need xattach... Stupid!
     $return = false;
     $parsedIDs = array_unique(ArrayUtil::toIntegerArray(self::getFirstParameters($message, 'xattach')));
     if (!empty($parsedIDs)) {
         $attachmentIDs = array();
         foreach ($parsedIDs as $attachmentID) {
             if ($attachmentID) {
                 $attachmentIDs[] = $attachmentID;
             }
         }
         if (!empty($attachmentIDs)) {
             $attachmentList = new AttachmentList();
             $attachmentList->getConditionBuilder()->add("attachment.attachmentID IN (?)", array($attachmentIDs));
             $attachmentList->readObjectIDs();
             $return = $attachmentList->getObjectIDs();
         }
     }
     return $return;
 }
开发者ID:Zumarta,项目名称:de.teralios.bbcodes,代码行数:24,代码来源:XAttachmentMessageEmbeddedObjectHandler.class.php


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