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


PHP Property::getName方法代码示例

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


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

示例1: add

 /**
  * Adds a Property. If Property already exists an Exception will be thrown.
  *
  * @param Property $property
  *
  * @return $this
  *
  * @throws \Exception
  */
 public function add(Property $property)
 {
     // Property already exists?
     if (null !== $this->get($property->getName())) {
         throw new \Exception("Property with name '{$property->getName()}' already exists");
     }
     $this->elements[] = $property;
     return $this;
 }
开发者ID:davefoster,项目名称:kanbanBoard,代码行数:18,代码来源:PropertyBag.php

示例2: loadXML

 public function loadXML($xml)
 {
     $dom = new \SimpleXMLElement($xml);
     if (!isset($dom->tokenXPath) || count($dom->tokenXPath) != 1) {
         throw new \LengthException('exactly one tokenXPath has to be provided');
     }
     $this->tokenXPath = $dom->tokenXPath;
     if (!isset($dom->tokenValueXPath) || count($dom->tokenValueXPath) != 1) {
         throw new \LengthException('exactly one tokenValueXPath has to be provided');
     }
     $this->tokenValueXPath = $dom->tokenValueXPath;
     if (!isset($dom->properties) || !isset($dom->properties->property) || count($dom->properties->property) == 0) {
         throw new \LengthException('no token properties defined');
     }
     $n = 1;
     $names = array();
     foreach ($dom->properties->property as $i) {
         $prop = new Property($i, $n++);
         $this->properties[] = $prop;
         $names[] = $prop->getName();
     }
     if (count($names) !== count(array_unique($names))) {
         throw new \RuntimeException('property names are not unique');
     }
     if (isset($dom->namespaces) && isset($dom->namespaces->namespace)) {
         foreach ($dom->namespaces->namespace as $i) {
             $this->namespaces[(string) $i->prefix[0]] = (string) $i->uri[0];
         }
     }
 }
开发者ID:acdh-oeaw,项目名称:tokeneditor,代码行数:30,代码来源:Schema.php

示例3: add

 /**
  * @param Property $property
  */
 public function add(Property $property)
 {
     $propertyName = $property->getName();
     if (isset($this->properties[$propertyName])) {
         $existantProperty = $this->properties[$propertyName];
         $this->properties[$propertyName] = $existantProperty->merge($property);
     } else {
         $this->properties[$propertyName] = $property;
     }
 }
开发者ID:ifnot,项目名称:tagmaker,代码行数:13,代码来源:Tag.php

示例4: __construct

 public function __construct(Property $property, User $user, $action)
 {
     $this->user = $user;
     $this->property = $property;
     $this->name = $property->getName();
     $this->datatype = $property->getDatatype();
     $this->description = $property->getDescription();
     $this->descr = $property->getDescr();
     $this->action = $action;
     $this->action_time = new \DateTime();
 }
开发者ID:samuvack,项目名称:admin,代码行数:11,代码来源:PropertyLog.php

示例5: addProperty

 /**
  * Bit of a messy way to add properties at a position.  Just so it doesn't muck about the generated property order.
  * As it's an associative array there's not a lot else that can be done.
  * It's not crucial that the order stays the same either.
  *
  * @param Property $property
  * @param null $insert_position
  * @param boolean $get_only
  */
 public function addProperty(Property $property, $insert_position = null, $get_only = false)
 {
     $key_name = strtolower($property->getName());
     if (isset($this->properties[$key_name]) && $get_only) {
         return;
     }
     $property->setModel($this);
     //This is so it can be retrospectively added in the case of deprecation.
     if ($insert_position !== null) {
         $properties = array();
         $property_position = 0;
         foreach ($this->properties as $existing_name => $existing_property) {
             if ($property_position++ === $insert_position) {
                 $properties[$key_name] = $property;
             }
             $properties[$existing_name] = $existing_property;
         }
         //Otherwise it's at the end (or after)
         if ($insert_position >= $property_position) {
             $properties[$key_name] = $property;
         }
         $this->properties = $properties;
     } else {
         $this->properties[$key_name] = $property;
     }
 }
开发者ID:elijan,项目名称:xero-php,代码行数:35,代码来源:Model.php

示例6: storeXtendedProperty

 /**
  * Store an xtended (unspecified, vendor extension) property.
  * @param Property $property The property to store.
  * @param string $uid The uid of the CONTACT to associate the new
  * record with.
  * @return integer The ID of the newly created record.
  */
 private function storeXtendedProperty(Property $property, $uid)
 {
     assert($this->connection !== null);
     assert(!empty($uid));
     assert(is_string($uid));
     $stmt = $this->prepareCannedQuery('store', 'xtended');
     $stmt->bindValue(':uid', $uid);
     $stmt->bindValue(':name', $property->getName());
     $stmt->bindValue(':value', $property->getValue());
     $stmt->bindValue(':valuetype', $property->getValueType(false));
     $stmt->bindValue('pref', $property->getPref(false), \PDO::PARAM_INT);
     $stmt->bindValue(':mediatype', $property->getMediaType());
     $stmt->bindValue(':propGroup', $property->getGroup());
     $stmt->execute();
     $propertyID = $this->connection->lastInsertId();
     $this->associateTypes($property, $propertyID, 'xtended');
     return $propertyID;
 }
开发者ID:evought,项目名称:vcard-tools,代码行数:25,代码来源:VCardDB.php

示例7: addProperty

 public function addProperty(Property $property)
 {
     $this->properties[$property->getName()] = $property;
     return $this;
 }
开发者ID:perinatologie,项目名称:hub-client-php,代码行数:5,代码来源:Resource.php

示例8: hasProperty

 /**
  * Whether or a given property is available in the collection of
  * properties for this object instance
  *
  * @param \Puml\Model\Property $property
  *
  * @return boolean
  * @since 0.1
  */
 public function hasProperty(Property $property)
 {
     return isset($this->properties[$property->getName()]);
 }
开发者ID:dannyvdsluijs,项目名称:puml,代码行数:13,代码来源:Object.php

示例9: with

 public function with(Property $property) : self
 {
     $clone = clone $this;
     $clone->properties[$property->getName()] = $property;
     return $clone;
 }
开发者ID:nelmio,项目名称:alice,代码行数:6,代码来源:PropertyBag.php

示例10: addProperty

 public function addProperty(Property $property)
 {
     $property->setEntity($this);
     $this->properties[$property->getName()] = $property;
 }
开发者ID:aeberh,项目名称:php-movico,代码行数:5,代码来源:Entity.php

示例11: addProperty

 public function addProperty(Property $property)
 {
     $this->properties[strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $property->getName()))] = $property;
 }
开发者ID:revinate,项目名称:KnpJsonSchemaBundle,代码行数:4,代码来源:Schema.php


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