示例#1
0
 /**
  * @param array $data
  */
 public function populateFromArray(array $data)
 {
     if (empty($data['event_uid'])) {
         throw new InvalidArgumentException('Invalid event_uid');
     }
     $this->uid = $data['event_uid'];
     $this->calendarId = $data['calendar_id'];
     $this->summary = $data['summary'];
     $this->description = $data['description'];
     $this->startsAt = DateUtil::createDateTime($data['start']);
     $this->endsAt = DateUtil::createDateTime($data['end']);
 }
示例#2
0
 /**
  * @param array $data
  */
 public function populateFromArray(array $data)
 {
     if (empty($data['calendar_id'])) {
         throw new InvalidArgumentException('Invalid calendar_id');
     }
     $this->calendarId = $data['calendar_id'];
     $this->startsAt = DateUtil::createDateTime($data['start']);
     $this->endsAt = DateUtil::createDateTime($data['end']);
     $this->status = self::normalizeStatus($data['free_busy_status']);
 }
示例#3
0
 /**
  * @dataProvider badParams
  */
 public function testInvalidTime($params)
 {
     $this->setExpectedException('InvalidArgumentException');
     DateUtil::createDateTime($params);
 }