Exemple #1
0
 /**
  * @param string $name
  * @param bool $isDefault
  * @param string $default_assignee_login
  * @return string
  * @throws NotConnectedException
  */
 public function createSubsystem($name, $isDefault, $default_assignee_login)
 {
     if (is_null($this->youtrack)) {
         throw new NotConnectedException();
     }
     $subsystem = new Subsystem(null, $this->youtrack);
     $subsystem->__set('name', $name);
     $subsystem->__set('isDefault', $isDefault);
     $subsystem->__set('defaultAssignee', $default_assignee_login);
     return $this->youtrack->createSubsystem($this->getShortName(), $subsystem);
 }
Exemple #2
0
 /**
  * This extra constructor sets subsystems, if they are present in the response
  *
  * @param \SimpleXMLElement $xml
  * @param Connection $youtrack
  */
 public function __construct(\SimpleXMLElement $xml = null, Connection $youtrack = null)
 {
     parent::__construct($xml, $youtrack);
     if (isset($xml->subsystems)) {
         $this->attributes['subsystems'] = array();
         foreach ($xml->subsystems->sub as $subsystemNode) {
             $system = new Subsystem(null, $youtrack);
             $system->__set('name', (string) $subsystemNode['value']);
             $this->attributes['subsystems'][] = $system;
         }
     }
     if (isset($xml->assigneesLogin)) {
         $this->attributes['assigneesUsers'] = array();
         foreach ($xml->assigneesLogin->sub as $assigneesLogin) {
             $user = new User(null, $youtrack);
             $user->__set('login', (string) $assigneesLogin['value']);
             $this->attributes['assigneesUsers'][] = $user;
         }
     }
 }