Example #1
0
 /**
  * @param  \SimpleXMLElement $xml
  * @return Label
  */
 public static function createFromXML(\SimpleXMLElement $xml)
 {
     $label = new Label();
     if (isset($xml->barcode) && $xml->barcode != '') {
         $label->setBarcode((string) $xml->barcode);
     }
     if (isset($xml->mimeType) && $xml->mimeType != '') {
         $label->setMimeType((string) $xml->mimeType);
     }
     if (isset($xml->bytes) && $xml->bytes != '') {
         $label->setBytes((string) base64_decode($xml->bytes));
     }
     return $label;
 }