本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: create
public static function create($type, $ddd, $number)
{
$instance = new self();
$instance->setType($type);
$instance->setDDD($ddd);
$instance->setNumber($number);
return $instance;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}