Beispiel #1
0
 /**
  * Version constructor.
  * @param \SimpleXMLElement|NULL $xml
  * @param Connection|NULL $youtrack
  */
 public function __construct(\SimpleXMLElement $xml = NULL, Connection $youtrack = NULL)
 {
     parent::__construct($xml, $youtrack);
     $check = $this->__get('description');
     if (empty($check)) {
         $this->__set('description', '');
     }
     $check = $this->__get('releaseDate');
     if (empty($check)) {
         $this->__set('releaseDate', NULL);
     }
 }
Beispiel #2
0
 public function __construct(\SimpleXMLElement $xml = NULL, Connection $youtrack = NULL)
 {
     parent::__construct($xml, $youtrack);
     if (!empty($xml)) {
         if (!empty($this->attributes['links'])) {
             $links = [];
             foreach ($xml->xpath('//field[@name="links"]') as $node) {
                 foreach ($node->children() as $link) {
                     $links[(string) $link] = ['type' => (string) $link->attributes()->type, 'role' => (string) $link->attributes()->role];
                 }
             }
             $this->__set('links', $links);
         }
         if (!empty($this->attributes['attachments'])) {
             $attachments = array();
             foreach ($xml->xpath('//field[@name="attachments"]') as $node) {
                 foreach ($node->children() as $attachment) {
                     $attachments[(string) $attachment] = ['url' => (string) $attachment->attributes()->url];
                 }
             }
             $this->__set('attachments', $attachments);
         }
     }
 }
 /**
  * ProjectCustomField constructor.
  * @param \SimpleXMLElement|NULL $xml
  * @param Connection|NULL $youtrack
  */
 public function __construct(\SimpleXMLElement $xml = NULL, Connection $youtrack = NULL)
 {
     parent::__construct($xml, $youtrack);
 }