Ejemplo n.º 1
0
 public static function create($name, $email, $created, $modified)
 {
     $new = new static();
     $new->name = h\string($name);
     $new->email = h\string($email);
     $new->created = h\date::new_from_sql($created);
     // XXX or null
     $new->modified = h\date::new_from_sql($modified);
     // XXX or null
     return $new;
 }
Ejemplo n.º 2
0
 public function __construct($year, $weekno)
 {
     $this->week = $weekno;
     $this->year = $year;
     parent::__construct();
     $day = date::new_from_format("{$year}-W{$weekno}");
     $this->push($day);
     while ($day->get_day_of_week() != 7) {
         $day = $day->tomorrow();
         $this->push($day);
     }
     // The day can be any day in a week. So we start to push
     // the asked day, then we push comming days, then we revert the day's storage, then we push
     // the passed days until the first, and revert the storage.
     /*
     $aday = $day;
     $this->push($aday);
     
     while($aday->get_day_of_week() != 7)
     {
     	$aday = $aday->tomorrow();
     	$this->push($aday);
     }
     
     $this->reverse();
     $aday = $day;
     
     while($aday->get_day_of_week() != 1)
     {
     	$aday = $aday->yesterday();
     	$this->push($aday);
     }
     
     $this->reverse();
     */
 }