Example #1
0
 public static function construct(IZDPCommandFrame $payload, $transaction_id = 0x0)
 {
     $frame = new self();
     $frame->setPayloadObject($payload);
     $frame->setTransactionId($transaction_id);
     return $frame;
 }
Example #2
0
 /**
  * Helper method to create a ZCL Frame
  *
  * @param IZCLCommandFrame $payload
  * @param int $manufacturer_id Optional Manufacturer ID
  * @param int $direction Direction
  * @param int $disable_default_response Disable default response
  * @param int $transaction_id Optional Transaction ID
  * @return ZCLFrame The Constructed ZCLFrame
  * @throws ZigbeeException If there were problems with composing the ZCL Frame
  */
 public static function construct(IZCLCommandFrame $payload = null, $manufacturer_id = null, $direction = self::DIRECTION_SERVER_TO_CLIENT, $disable_default_response = self::DEFAULT_RESPONSE_ENABLED, $transaction_id = null)
 {
     $frame = new self();
     if ($manufacturer_id !== null) {
         $frame->setManufacturerIdPresent(true);
         $frame->setManufacturerId($manufacturer_id);
     }
     $frame->setDirection($direction);
     $frame->setDisableDefaultResponse($disable_default_response);
     if ($transaction_id !== null) {
         $frame->setTransactionId($transaction_id);
     }
     if ($payload !== null) {
         $frame->setPayloadObject($payload);
     }
     return $frame;
 }
 /**
  * Initialization method
  * @param stdClass $Object object for initialization
  * @return RenewableReceipt initialized receipt for auto-renewable subscription
  */
 public static function initializeByObject(stdClass $Object)
 {
     $Receipt = new self();
     if (isset($Object->app_item_id)) {
         $Receipt->setAppItemId($Object->app_item_id);
     }
     if (isset($Object->bid)) {
         $Receipt->setBid($Object->bid);
     }
     if (isset($Object->bvrs)) {
         $Receipt->setBvrs($Object->bvrs);
     }
     if (isset($Object->product_id)) {
         $Receipt->setProductId($Object->product_id);
     }
     if (isset($Object->quantity)) {
         $Receipt->setQuantity($Object->quantity);
     }
     if (isset($Object->transaction_id)) {
         $Receipt->setTransactionId($Object->transaction_id);
     }
     if (isset($Object->original_transaction_id)) {
         $Receipt->setOriginalTransactionId($Object->original_transaction_id);
     }
     if (isset($Object->purchase_date)) {
         $Receipt->setPurchaseDate($Object->purchase_date);
     }
     if (isset($Object->original_purchase_date)) {
         $Receipt->setOriginalPurchaseDate($Object->original_purchase_date);
     }
     if (isset($Object->cancellation_date)) {
         $Receipt->setCancellationDate($Object->cancellation_date);
     }
     if (isset($Object->web_order_line_item_id)) {
         $Receipt->setWebOrderLineItemId($Object->web_order_line_item_id);
     }
     if (isset($Object->expires_date)) {
         $Receipt->setExpiresDate($Object->expires_date);
     }
     return $Receipt;
 }