public function __construct(callable $factory, array $options = [])
 {
     parent::__construct($options);
     $this->factory = $factory;
 }
Exemplo n.º 2
0
 /**
  * Constructor
  * 
  * @param DataObject $object The object that has_many somethings that we're calculating the aggregate for 
  * @param string $relationship The name of the relationship
  * @param string $filter (optional) An SQL filter to apply to the relationship rows before calculating the
  *                       aggregate
  */
 public function __construct($object, $relationship, $filter = '')
 {
     $this->object = $object;
     $this->relationship = $relationship;
     $this->has_many = $object->has_many($relationship);
     $this->many_many = $object->many_many($relationship);
     if (!$this->has_many && !$this->many_many) {
         user_error("Could not find relationship {$relationship} on object class {$object->class} in" . " Aggregate Relationship", E_USER_ERROR);
     }
     parent::__construct($this->has_many ? $this->has_many : $this->many_many[1], $filter);
 }
Exemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
     $this->range = "today";
 }