當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。