Esempio n. 1
0
 /**
  * Constructor
  * 
  * @param AgileZen $service
  * @param array $data 
  */
 public function __construct(AgileZen $service, array $data)
 {
     if (!array_key_exists('id', $data)) {
         throw new Exception\InvalidArgumentException("You must pass the id of the comment");
     }
     $this->text = $data['text'];
     $this->createTime = $data['createTime'];
     $this->author = new User($service, $data['author']);
     $this->projectId = $data['projectId'];
     $this->service = $service;
     parent::__construct($data['id']);
 }
Esempio n. 2
0
 /**
  * Constructor
  * 
  * @param AgileZen $service
  * @param array $data 
  */
 public function __construct(AgileZen $service, array $data)
 {
     if (!array_key_exists('id', $data)) {
         throw new Exception\InvalidArgumentException("You must pass the id of the user");
     }
     if (!array_key_exists('name', $data)) {
         throw new Exception\InvalidArgumentException("You must pass the name of the user");
     }
     $this->name = $data['name'];
     $this->service = $service;
     $this->projectId = $data['projectId'];
     parent::__construct($data['id']);
 }
Esempio n. 3
0
 /**
  * Constructor
  * 
  * @param AgileZen $service
  * @param array $data 
  */
 public function __construct(AgileZen $service, array $data)
 {
     if (!array_key_exists('id', $data)) {
         throw new Exception\InvalidArgumentException("You must pass the id of the project");
     }
     if (!array_key_exists('name', $data)) {
         throw new Exception\InvalidArgumentException("You must pass the name of the project");
     }
     $this->name = $data['name'];
     $this->description = $data['description'];
     $this->createTime = $data['createTime'];
     $this->owner = new User($service, $data['owner']);
     $this->service = $service;
     parent::__construct($data['id']);
 }
Esempio n. 4
0
 /**
  * Constructor
  * 
  * @param AgileZen $service
  * @param array $data 
  */
 public function __construct(AgileZen $service, array $data)
 {
     if (!array_key_exists('id', $data)) {
         throw new Exception\InvalidArgumentException("You must pass the id of the role");
     }
     if (!array_key_exists('name', $data)) {
         throw new Exception\InvalidArgumentException("You must pass the name of the role");
     }
     $this->name = $data['name'];
     if (isset($data['access'])) {
         $this->access = $data['access'];
     }
     if (!empty($data['members'])) {
         $this->members = new Container($service, $data['members'], 'user');
     }
     $this->service = $service;
     $this->projectId = $data['projectId'];
     parent::__construct($data['id']);
 }
Esempio n. 5
0
 /**
  * Constructor
  * 
  * @param AgileZen $service
  * @param array $data 
  */
 public function __construct(AgileZen $service, array $data)
 {
     if (!array_key_exists('id', $data)) {
         throw new Exception\InvalidArgumentException("You must pass the id of the user");
     }
     $this->text = $data['text'];
     if (isset($data['details'])) {
         $this->details = $data['details'];
     }
     $this->size = $data['size'];
     $this->color = $data['color'];
     if (isset($data['priority'])) {
         $this->priority = $data['priority'];
     }
     if (isset($data['deadline'])) {
         $this->deadline = $data['deadline'];
     }
     $this->status = $data['status'];
     $this->projectId = $data['project']['id'];
     $this->phaseId = $data['phase']['id'];
     if (isset($data['creator']) && !empty($data['creator'])) {
         $this->creator = new User($service, $data['creator']);
     }
     if (isset($data['owner']) && !empty($data['owner'])) {
         $this->owner = new User($service, $data['owner']);
     }
     if (isset($data['tags']) && is_array($data['tags'])) {
         $this->tags = new Container($service, $data['tags'], 'tag', $this->projectId);
     }
     $this->service = $service;
     parent::__construct($data['id']);
 }
Esempio n. 6
0
 /**
  * Constructor
  * 
  * @param AgileZen $service
  * @param array $data 
  */
 public function __construct(AgileZen $service, array $data)
 {
     if (!array_key_exists('id', $data)) {
         throw new Exception\InvalidArgumentException("You must pass the id of the task");
     }
     $this->text = $data['text'];
     $this->createTime = $data['createTime'];
     $this->status = $data['status'];
     $this->projectId = $data['projectId'];
     if (isset($data['finishTime'])) {
         $this->finishTime = $data['finishTime'];
     }
     if (isset($data['finishedBy']) && !empty($data['finishedBy'])) {
         $this->finishedBy = new User($service, $data['finishedBy']);
     }
     $this->service = $service;
     parent::__construct($data['id']);
 }
Esempio n. 7
0
 /**
  * Constructor
  * 
  * @param AgileZen $service
  * @param array $data 
  */
 public function __construct(AgileZen $service, array $data)
 {
     if (!array_key_exists('id', $data)) {
         throw new Exception\InvalidArgumentException("You must pass the id of the invite");
     }
     $this->createTime = $data['createTime'];
     $data['role']['projectId'] = $data['projectId'];
     $this->email = $data['email'];
     $this->token = $data['token'];
     $this->sender = new User($service, $data['sender']);
     $this->role = new Role($service, $data['role']);
     $this->projectId = $data['projectId'];
     $this->service = $service;
     parent::__construct($data['id']);
 }
Esempio n. 8
0
 /**
  * Constructor
  * 
  * @param AgileZen $service
  * @param array $data 
  */
 public function __construct(AgileZen $service, array $data)
 {
     if (!array_key_exists('id', $data)) {
         throw new Exception\InvalidArgumentException("You must pass the id of the attachment");
     }
     $this->fileName = $data['fileName'];
     $this->size = $data['sizeInBytes'];
     $this->contentType = $data['contentType'];
     $this->token = $data['token'];
     $this->projectId = $data['projectId'];
     $this->service = $service;
     parent::__construct($data['id']);
 }