• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ArgumentValidator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setDisplayName

 /**
  * Sets the display name of this menu item.
  * @access public
  * @param string text The new display name.
  **/
 function setDisplayName($text)
 {
     // ** parameter validation
     ArgumentValidator::validate($text, StringValidatorRule::getRule(), true);
     // ** end of parameter validation
     $this->_text = $text;
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:12,代码来源:MenuItem.class.php


示例2: createComponentForPartStructure

 /**
  * Create a new PrimitiveIO object that allows for selection from an authority
  * list
  * 
  * @param <##>
  * @return <##>
  * @access public
  * @since 5/1/06
  */
 static function createComponentForPartStructure($partStruct)
 {
     ArgumentValidator::validate($partStruct, ExtendsValidatorRule::getRule("PartStructure"));
     $partStructType = $partStruct->getType();
     // get the datamanager data type
     $dataType = $partStructType->getKeyword();
     // 		printpre($dataType);
     $authoritativeValues = $partStruct->getAuthoritativeValues();
     if ($authoritativeValues->hasNext()) {
         $authZManager = Services::getService("AuthZ");
         $idManager = Services::getService("Id");
         if ($authZManager->isUserAuthorized($idManager->getId("edu.middlebury.authorization.modify_authority_list"), $partStruct->getRepositoryId())) {
             $component = new PrimitiveIO_AuthoritativeContainer();
             $component->setSelectComponent(PrimitiveIOManager::createAuthoritativeComponent($dataType));
             $component->setNewComponent(PrimitiveIOManager::createComponent($dataType));
         } else {
             $component = PrimitiveIOManager::createAuthoritativeComponent($dataType);
         }
         while ($authoritativeValues->hasNext()) {
             $component->addOptionFromSObject($authoritativeValues->next());
         }
     } else {
         // get the simple component for this data type
         $component = PrimitiveIOManager::createComponent($dataType);
     }
     return $component;
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:36,代码来源:PrimitiveIOManager.class.php


示例3: __construct

 /**
  * Constructor
  * 
  * @param object XmlSiteDirector $director
  * @param object DOMElement $element
  * @return object XmlSiteNavBlockSiteComponent
  * @access public
  * @since 4/3/06
  */
 function __construct(AssetSiteDirector $director, Asset $asset, $element)
 {
     ArgumentValidator::validate($element, OptionalRule::getRule(ExtendsValidatorRule::getRule('DOMElement')));
     $this->_director = $director;
     $this->_asset = $asset;
     $this->_element = $element;
 }
开发者ID:adamfranco,项目名称:segue,代码行数:16,代码来源:AssetSiteComponent.class.php


示例4: HarmoniReadableLog

 /**
  * Constructor
  * 
  * @param string $name
  * @return object
  * @access public
  * @since 3/1/06
  */
 function HarmoniReadableLog($name, $dbIndex)
 {
     ArgumentValidator::validate($name, StringValidatorRule::getRule());
     ArgumentValidator::validate($dbIndex, IntegerValidatorRule::getRule());
     $this->_name = $name;
     $this->_dbIndex = $dbIndex;
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:15,代码来源:HarmoniReadableLog.class.php


示例5: __construct

 /**
  * Constructor.
  * 
  * @param string $baseName A name for the file.
  * @param optional DateAndTime $timestamp The Modification date/time
  * @return null
  * @access public
  * @since 5/6/08
  */
 public function __construct($baseName, DateAndTime $timestamp = null)
 {
     ArgumentValidator::validate($baseName, NonzeroLengthStringValidatorRule::getRule());
     $this->baseName = $baseName;
     $this->contents = '';
     $this->timestamp = $timestamp;
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:16,代码来源:TempFile.class.php


示例6: setDisplayName

 /**
  * Sets the display name of this menu item.
  * @access public
  * @param string displayName The new display name.
  **/
 function setDisplayName($displayName)
 {
     // ** parameter validation
     ArgumentValidator::validate($displayName, StringValidatorRule::getRule(), true);
     // ** end of parameter validation
     $this->_displayName = $displayName;
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:12,代码来源:MenuItemHeading.class.php


示例7: __construct

 /**
  * Constructor. Sign up for reCAPTCHA keys at http://recaptcha.net/
  * 
  * @param string $publicKey
  * @param string $privateKey
  * @return void
  * @access public
  * @since 6/4/08
  */
 public function __construct($publicKey, $privateKey)
 {
     ArgumentValidator::validate($publicKey, NonzeroLengthStringValidatorRule::getRule());
     ArgumentValidator::validate($privateKey, NonzeroLengthStringValidatorRule::getRule());
     $this->_publicKey = $publicKey;
     $this->_privateKey = $privateKey;
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:16,代码来源:WReCaptcha.class.php


示例8: PersistentOrderedSet

 /**
  * Constructor.
  * @param object Id $setId The Id of this set.
  * @param integer $dbIndex The index of the database connection which has
  * 		tables in which to store the set.
  */
 function PersistentOrderedSet($setId, $dbIndex)
 {
     parent::OrderedSet($setId);
     ArgumentValidator::validate($dbIndex, IntegerValidatorRule::getRule(), true);
     // Create our internal array
     $this->_dbIndex = $dbIndex;
     // populate our array with any previously stored items.
     $query = new SelectQuery();
     $query->addColumn("item_order", "item_order");
     $query->addColumn("item_id", "item_id");
     $query->addTable("sets");
     $query->addWhere("id = '" . addslashes($this->_setId->getIdString()) . "'");
     $query->addOrderBy("item_order");
     $dbHandler = Services::getService("DatabaseManager");
     $result = $dbHandler->query($query, $this->_dbIndex);
     $i = 0;
     $oldItems = array();
     while ($result->hasMoreRows()) {
         // Add the items to our array
         $this->_items[$i] = $result->field("item_id");
         // Store an array of the order-key/value relationships to reference
         // when updating any inconsistancies in order numbering.
         $oldItems[$result->field("item_order")] = $result->field("item_id");
         $i++;
         $result->advanceRow();
     }
     $result->free();
     // Make sure that we have our set is filled from 0 to count()
     reset($oldItems);
     $this->_updateOrders($oldItems);
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:37,代码来源:PersistentOrderedSet.class.php


示例9: FromNodesAssetIterator

 /**
  * Constructor
  * 
  * @param object NodeIterator $nodes
  * @param object Repository $repository
  * @return object
  * @access public
  * @since 5/4/06
  */
 function FromNodesAssetIterator($nodes, $repository)
 {
     // 		ArgumentValidator::validate($nodes, ExtendsValidatorRule::getRule("Iterator"));
     ArgumentValidator::validate($repository, ExtendsValidatorRule::getRule("Repository"));
     $this->_nodes = $nodes;
     $this->_repository = $repository;
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:16,代码来源:FromNodesAssetIterator.class.php


示例10: MenuItemLinkWithAdditionalHtml

 /**
  * The constructor.
  * @param string displayName The display name of this menu item.
  * @param string url The url of this menu item.
  * @param boolean selected The selected state of this menu item.
  * @param integer index The index of this component. The index has no semantic meaning: 
  * you can think of the index as 'level' of the component. Alternatively, 
  * the index could serve as means of distinguishing between components with 
  * the same type. Most often one would use the index in conjunction with
  * the <code>getStylesForComponentType()</code> and 
  * <code>addStyleForComponentType()</code> methods.
  * @param string target The target window of this menu item.
  * @param string accessKey The access key (shortcut) of this menu item.
  * @param string toolTip The toolTip of this menu item.
  * @access public
  **/
 function MenuItemLinkWithAdditionalHtml($displayName, $url, $selected, $index, $target = null, $accessKey = null, $toolTip = null, $additionalHtml = '')
 {
     ArgumentValidator::validate($additionalHtml, StringValidatorRule::getRule());
     // ** end of parameter validation
     $this->_additionalHtml = $additionalHtml;
     $this->MenuItemLink($displayName, $url, $selected, $index, $target, $accessKey, $toolTip);
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:23,代码来源:MenuItemLinkWithAdditionalHtml.class.php


示例11: updateDisplayName

 function updateDisplayName($newDisplayName)
 {
     //make sure its a string
     ArgumentValidator::validate($newDisplayName, new StringValidatorRule(), true);
     //set the display name in the object
     $this->getNode()->updateDisplayName($newDisplayName);
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:7,代码来源:HarmoniEditableAgent.class.php


示例12: HarmoniEntry

 /**
  * Constructor
  * 
  * @param mixed $entryItem
  * @param object Type $formatType
  * @param object Type $priorityType
  * @return object
  * @access public
  * @since 3/1/06
  */
 function HarmoniEntry($timestamp, $category, $description, $backtrace, $agents, $nodes, $formatType, $priorityType)
 {
     ArgumentValidator::validate($timestamp, ExtendsValidatorRule::getRule("DateAndTime"));
     ArgumentValidator::validate($category, StringValidatorRule::getRule());
     ArgumentValidator::validate($description, StringValidatorRule::getRule());
     ArgumentValidator::validate($backtrace, StringValidatorRule::getRule());
     ArgumentValidator::validate($agents, ArrayValidatorRule::getRule());
     ArgumentValidator::validate($nodes, ArrayValidatorRule::getRule());
     ArgumentValidator::validate($formatType, ExtendsValidatorRule::getRule("Type"));
     ArgumentValidator::validate($priorityType, ExtendsValidatorRule::getRule("type"));
     $this->_timestamp = $timestamp;
     $this->_formatType = $formatType;
     $this->_priorityType = $priorityType;
     $this->_entryItem = new AgentNodeEntryItem($category, $description);
     $this->_entryItem->setBacktrace($backtrace);
     $idManager = Services::getService("Id");
     foreach ($agents as $idString) {
         if ($idString) {
             $this->_entryItem->addAgentId($idManager->getId($idString));
         }
     }
     foreach ($nodes as $idString) {
         if ($idString) {
             $this->_entryItem->addNodeId($idManager->getId($idString));
         }
     }
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:37,代码来源:HarmoniEntry.class.php


示例13: __construct

 /**
  * Constructor.
  * 
  * @param string $path
  * @return null
  * @access public
  * @since 5/6/08
  */
 public function __construct($path)
 {
     ArgumentValidator::validate($path, NonzeroLengthStringValidatorRule::getRule());
     if (!file_exists($path) || is_dir($path)) {
         throw new InvalidArgumentException("'" . $path . "' is not a valid file.", 78345);
     }
     $this->path = $path;
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:16,代码来源:FileSystemFile.class.php


示例14: addSQLQuery

 /**
  * Adds one SQL string to this query.
  * @access public
  * @param string sql One SQL string,
  * @return void 
  */
 function addSQLQuery($sql)
 {
     // ** parameter validation
     $stringRule = StringValidatorRule::getRule();
     ArgumentValidator::validate($sql, $stringRule, true);
     // ** end of parameter validation
     $this->_sql[] = $sql;
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:14,代码来源:GenericSQLQuery.class.php


示例15: addDataType

 /**
  * Adds a specific data type (identified by a string such as "integer") to our registry. Each data type has two classes associated with it: a {@link Primitive} and a {@link StorablePrimitive}. The former is used when setting/getting values, the latter used when talking with the database.
  * @param string $typeName The name (such as "integer" or "boolean") of this new data type.
  * @param string $primitiveClass The name of the {@link Primitive} class.
  * @param string $storablePrimitiveClass The name of the {@link StorablePrimitive} class.
  * @param string $conversionMethod
  * @access public
  * @return void
  */
 function addDataType($typeName, $primitiveClass, $storablePrimitiveClass, $conversionMethod)
 {
     ArgumentValidator::validate($conversionMethod, StringValidatorRule::getRule());
     $this->_registeredTypes[$typeName] = array("primitive" => $primitiveClass, "storable" => $storablePrimitiveClass, "ConversionMethod" => $conversionMethod);
     if (!in_array(strtolower($storablePrimitiveClass), $this->_primitiveClassMapping)) {
         $this->_primitiveClassMapping[] = strtolower($storablePrimitiveClass);
     }
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:17,代码来源:DataTypeManager.class.php


示例16: addComponent

 /**
  * Adds a {@link WizardComponent} to this component. It will return the newly added component.
  * @param string $name The short-string name of the component - this is used for creating form input field names and storing data.
  * @param ref object $component A {@link WizardComponent} to add.
  * @access public
  * @return ref object
  */
 function addComponent($name, $component)
 {
     ArgumentValidator::validate($name, NonZeroLengthStringValidatorRule::getRule());
     ArgumentValidator::validate($component, ExtendsValidatorRule::getRule('WizardComponent'));
     $this->_children[preg_replace("/[^a-zA-Z0-9:_-]/", "_", $name)] = $component;
     $component->setParent($this);
     return $component;
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:15,代码来源:WizardComponentWithChildren.abstract.php


示例17: addStep

 /**
  * Adds a new {@link WizardStep} to this container.
  * @param string $name A reference/ID name for this wizard.
  * @param ref object $step
  * @access public
  * @return ref object The new step object.
  */
 function addStep($name, $step)
 {
     ArgumentValidator::validate($step, ExtendsValidatorRule::getRule("WizardStep"), true);
     $name = preg_replace("/[^a-zA-Z0-9:_\\-]/", "_", $name);
     $this->_steps[] = $step;
     $this->_stepNames[] = $name;
     $step->setParent($this);
     return $step;
 }
开发者ID:adamfranco,项目名称:polyphony,代码行数:16,代码来源:WizardStepContainer.class.php


示例18: PostgreSQLUpdateQueryResult

 /**
  * The constructor.
  * @access public
  * @param integer $resourceId The resource id for this query.
  */
 function PostgreSQLUpdateQueryResult($resourceId)
 {
     // ** parameter validation
     $resourceRule = ResourceValidatorRule::getRule();
     ArgumentValidator::validate($resourceId, $resourceRule, true);
     // ** end of parameter validation
     $this->_resourceId = $resourceId;
     $this->_numberOfRows = pg_affected_rows($this->_resourceId);
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:14,代码来源:PostgreSQLUpdateQueryResult.class.php


示例19: addValue

 /**
  * Sets the value of this hidden field.
  * @param string $value
  * @access public
  * @return void
  */
 function addValue($id, $name)
 {
     ArgumentValidator::validate($id, NonzeroLengthStringValidatorRule::getRule());
     ArgumentValidator::validate($name, NonzeroLengthStringValidatorRule::getRule());
     if (strlen($this->_value)) {
         $this->_value .= '&';
     }
     $this->_value .= rawurlencode($id) . '=' . rawurlencode($name);
 }
开发者ID:adamfranco,项目名称:segue,代码行数:15,代码来源:MembersButton.class.php


示例20: MySQLDeleteQueryResult

 /**
  * Creates a new MySQLDeleteQueryResult object.
  * Creates a new MySQLDeleteQueryResult object.
  * @access public
  * @param integer $linkId The link identifier for the database connection.
  * @return object MySQLDeleteQueryResult A new MySQLDeleteQueryResult object.
  */
 function MySQLDeleteQueryResult($linkId)
 {
     // ** parameter validation
     $resourceRule = ResourceValidatorRule::getRule();
     ArgumentValidator::validate($linkId, $resourceRule, true);
     // ** end of parameter validation
     $this->_linkId = $linkId;
     $this->_numberOfRows = mysql_affected_rows($this->_linkId);
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:16,代码来源:MySQLDeleteQueryResult.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AriKernel类代码示例发布时间:2022-05-23
下一篇:
PHP Argument类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap