Exemplo n.º 1
0
 /**
  * Sets a multi-valued property.
  *
  * You may also specify DateTime objects here.
  *
  * @param array $parts
  *
  * @return void
  */
 function setParts(array $parts)
 {
     if (isset($parts[0]) && $parts[0] instanceof DateTimeInterface) {
         $this->setDateTimes($parts);
     } else {
         parent::setParts($parts);
     }
 }
Exemplo n.º 2
0
 /**
  * Sets a multi-valued property.
  *
  * You may also specify DateTime objects here.
  *
  * @param array $parts
  * @return void
  */
 public function setParts(array $parts)
 {
     if (count($parts) > 1) {
         throw new \InvalidArgumentException('Only one value allowed');
     }
     if (isset($parts[0]) && $parts[0] instanceof \DateTime) {
         $this->setDateTime($parts[0]);
     } else {
         parent::setParts($parts);
     }
 }