You are here

function MerciHours::__construct in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

Initialize object attributes and decode `week`.

Overrides Entity::__construct

File

merci_hours/includes/entity.inc, line 35

Class

MerciHours
Define a WorkCalendar object with its operations.

Code

function __construct(array $values = array(), $entityType = 'merci_hours') {
  parent::__construct($values, $entityType);
  $this->week_days = array();
  foreach ($this
    ->dayCodes() as $name => $code) {
    if ($this->week & $code) {
      $this->week_days[$name] = $name;
    }
  }
}