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


PHP self::setType方法代码示例

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


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

示例1: parse

 public static function parse($isAddress = TRUE)
 {
     $SCA = new self($isAddress);
     $size = hexdec(PDU::getPduSubstr(2));
     if ($size) {
         // if is OA or DA size in digits
         if ($isAddress) {
             if ($size % 2 != 0) {
                 $size++;
             }
             // else size in octets
         } else {
             $size--;
             $size *= 2;
         }
         $SCA->setType(new SCA\Type(hexdec(PDU::getPduSubstr(2))));
         $hex = PDU::getPduSubstr($size);
         switch ($SCA->getType()->getType()) {
             case SCA\Type::TYPE_UNKNOWN:
             case SCA\Type::TYPE_INTERNATIONAL:
             case SCA\Type::TYPE_ACCEPTER_INTO_NET:
             case SCA\Type::TYPE_SUBSCRIBER_NET:
             case SCA\Type::TYPE_TRIMMED:
                 $SCA->setPhone(rtrim(implode("", array_map('strrev', array_map(array('self', '_map_filter_decode'), str_split($hex, 2)))), 'F'));
                 break;
             case SCA\Type::TYPE_ALPHANUMERICAL:
                 $SCA->setPhone(PDU\Helper::decode7bit($hex));
                 break;
         }
     }
     return $SCA;
 }
开发者ID:jackkum,项目名称:phppdu,代码行数:32,代码来源:SCA.php

示例2: buildFromResponse

 /**
  * Build a paymentMethod entity based on a json-decoded payment_method stdClass
  *
  * @param  stdClass $response The payment method data
  * @return Syspay_Merchant_Entity_PaymentMethod The payment method object
  */
 public static function buildFromResponse(stdClass $response)
 {
     $paymentMethod = new self();
     $paymentMethod->setType(isset($response->type) ? $response->type : null);
     $paymentMethod->setDisplay(isset($response->display) ? $response->display : null);
     return $paymentMethod;
 }
开发者ID:antho-girard,项目名称:syspay,代码行数:13,代码来源:PaymentMethod.php

示例3: __set_state

 /**
  * setState (convert from array to object).
  *
  * @return string
  */
 public static function __set_state($array)
 {
     $businessPropery = new self();
     $businessPropery->setType($array['type']);
     $businessPropery->setEntityProperty($array['entityProperty']);
     return $businessPropery;
 }
开发者ID:victoire,项目名称:victoire,代码行数:12,代码来源:BusinessProperty.php

示例4: create

 public static function create($type, $ddd, $number)
 {
     $instance = new self();
     $instance->setType($type);
     $instance->setDDD($ddd);
     $instance->setNumber($number);
     return $instance;
 }
开发者ID:lucasmro,项目名称:clearsale,代码行数:8,代码来源:Phone.php

示例5: factory

 /**
  * @param Schema   $schema
  * @param Property $property
  * @param string $operationType
  * @return Operation
  */
 public static function factory(Schema $schema, Property $property, $operationType)
 {
     $operation = new self();
     $operation->setType($operationType);
     $operation->setSchema($schema);
     $operation->setPath($property->getPath());
     $operation->setValue($property->getValue());
     return $operation;
 }
开发者ID:svn2github,项目名称:rackspace-cloud-files-cdn,代码行数:15,代码来源:Operation.php

示例6: create

 public static function create($target = null, $method = null, array $args = null, $type = null)
 {
     $request = new self();
     $request->setTarget($target);
     $request->setMethod($method);
     $request->setArgs($args);
     $request->setType($type);
     return $request;
 }
开发者ID:MrYogi,项目名称:hasoffers-promotional-platform,代码行数:9,代码来源:Request.php

示例7: parse

 public static function parse()
 {
     $byte = hexdec(PDU::getPduSubstr(2));
     $self = new self();
     $self->setPid($byte >> 6);
     $self->setIndicates($byte >> 5);
     $self->setType($byte);
     return $self;
 }
开发者ID:jackkum,项目名称:phppdu,代码行数:9,代码来源:PID.php

示例8: create

 public static function create($type, $data = null)
 {
     $o = new self();
     $o->FIN = true;
     $o->payloadData = $data;
     $o->payloadLength = $data != null ? strlen($data) : 0;
     $o->setType($type);
     return $o;
 }
开发者ID:rb-cohen,项目名称:phpws,代码行数:9,代码来源:WebSocketFrame.php

示例9: parseFromCdbXml

 /**
  * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement
  *     $xmlElement)
  * @return CultureFeed_Cdb_Data_Category
  */
 public static function parseFromCdbXml(SimpleXMLElement $xmlElement)
 {
     $language = new self((string) $xmlElement);
     $attributes = $xmlElement->attributes();
     if (isset($attributes['type'])) {
         $language->setType((string) $attributes['type']);
     }
     return $language;
 }
开发者ID:cultuurnet,项目名称:cdb,代码行数:14,代码来源:Language.php

示例10: createPage

 /**
  * @param string      $title
  * @param string      $urn
  * @param string|null $theme
  * @param string|null $layout
  *
  * @return Node
  */
 public static function createPage($title, $urn, $theme = null, $layout = null)
 {
     $page = new self();
     $page->setType(self::TYPE_PAGE);
     $page->setTitle($title);
     $page->setUrn($urn);
     $page->setTheme($theme);
     $page->setLayout($layout);
     return $page;
 }
开发者ID:jarves,项目名称:jarves,代码行数:18,代码来源:Node.php

示例11: sql

 /**
  * @param $queryStr
  * @param $params
  * @return Query
  */
 public static function sql($queryStr, $params = null)
 {
     $query = new self();
     if ($params) {
         $query->params = $params;
     }
     $query->setType(self::TYPE_QUERY);
     $query->query = $queryStr;
     return $query;
 }
开发者ID:jayacode,项目名称:framework,代码行数:15,代码来源:Query.php

示例12: initWithArray

 public static function initWithArray($array)
 {
     $instance = new self(NULL, NULL, NULL, NULL, NULL);
     $instance->setName($array[Location::LOCATION_NAME]);
     $instance->setId($array[Location::LOCATION_ID]);
     $instance->setLattitude($array[Location::LOCATION_LATTITUDE]);
     $instance->setLongitude($array[Location::LOCATION_LONGITUDE]);
     $instance->setType($array[Location::LOCATION_TYPE]);
     return $instance;
 }
开发者ID:anasanzari,项目名称:tathva-organizer,代码行数:10,代码来源:Location.php

示例13: create

 /**
  * @param string $id
  * @param string $type
  * @param string $legalDocument
  * @param string $name
  * @param Address $address
  * @param Phone $phone
  * @return Customer
  */
 public static function create($id, $type, $legalDocument, $name, Address $address, $phone)
 {
     $instance = new self();
     $instance->setId($id);
     $instance->setType($type);
     $instance->setLegalDocument1($legalDocument);
     $instance->setName($name);
     $instance->setAddress($address);
     $instance->addPhone($phone);
     return $instance;
 }
开发者ID:lucasmro,项目名称:clearsale,代码行数:20,代码来源:CustomerShippingData.php

示例14: add

 /**
  * @param string $key     Input field key
  * @param string $type    Input field type
  * @param array  $options
  */
 public function add($key, $type = self::TYPE_STRING, $options = [])
 {
     $node = new self();
     $node->setType($type);
     if (isset($options['required'])) {
         $node->setRequired($options['required']);
     }
     if (isset($options['constraints'])) {
         $node->setConstraints($options['constraints']);
     }
     $this->offsetSet($key, $node);
     return $node;
 }
开发者ID:code-community,项目名称:input,代码行数:18,代码来源:FieldNode.php

示例15: fromArray

 /**
  * @param array $array
  * @return $this
  */
 public static function fromArray(array $array)
 {
     if (isset($array["type"]) === false || isset($array["id"]) === false) {
         return null;
     }
     $resourceIdentifier = new self();
     $resourceIdentifier->setType($array["type"]);
     $resourceIdentifier->setId($array["id"]);
     if (isset($array["meta"]) === true) {
         $resourceIdentifier->setMeta($array["meta"]);
     }
     return $resourceIdentifier;
 }
开发者ID:garethwi,项目名称:yin,代码行数:17,代码来源:ResourceIdentifier.php


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