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


PHP ArgumentValidator类代码示例

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


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


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