Example #1
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $appSettings = new Settings();
     $appSettings->setBrandName('OpenSkedge')->setPruneAfter(12)->setWeekStartDay('sunday')->setWeekStartDayClock('sunday')->setDefaultTimeResolution('1 hour')->setStartHour('06:00:00')->setEndHour('20:00:00');
     $manager->persist($appSettings);
     $manager->flush();
 }
Example #2
0
 /**
  * Take a \DateTime object and get the date of the first day of its week
  * dependant on global application settings.
  *
  * @param \DateTime $date  A given date
  * @param boolean   $clock The locale week start day or time clock week start day
  *
  * @return \DateTime
  */
 public function getFirstDayOfWeek(\DateTime $date, $clock = false)
 {
     if ($clock) {
         $day = $this->appSettings->getWeekStartDayClock();
     } else {
         $day = $this->appSettings->getWeekStartDay();
     }
     $firstDay = idate('w', strtotime($day));
     $offset = 7 - $firstDay;
     $ret = clone $date;
     $ret->modify(-(($date->format('w') + $offset) % 7) . 'days');
     $ret->modify('midnight');
     return $ret;
 }
Example #3
0
 /**
  * Run tests to ensure the output is correct for set/getMassEmail
  *
  * @return void
  */
 public function testMassEmail()
 {
     $settings = new Settings();
     $settings->setMassEmail("*****@*****.**");
     $this->assertEquals("*****@*****.**", $settings->getMassEmail());
 }
 public function getEndHour()
 {
     return $this->appSettings->getEndHour();
 }