3 class ScheduleParameters {
4 public function __construct($rawData) {
5 if(!php_Boot::$skip_constructor) {
6 $data = php_Lib::hashOfAssociativeArray($rawData);
7 $this->row_id = $data->get("row_id");
8 $raw_order = $data->get("row_order");
9 $this->mode = ScheduleMode::$Move;
10 $row_ids = new _hx_array($raw_order);
11 if($row_ids !== null) {
12 $this->rowDetails = new Hash();
16 while($_g < $row_ids->length) {
22 $o = php_Lib::objectOfAssociativeArray($d);
23 $quantity = Std::parseInt($o->quantity);
26 $this->rowDetails->set($id, _hx_anonymous(array("id" => $id, "quantity" => $quantity, "position" => $position)));
28 unset($quantity,$id,$d);
33 public function priority($order) {
34 $orderId = ItemScheduler::orderId($order);
35 $orderPosition = $this->position($orderId);
36 return (($orderPosition !== null) ? $orderPosition : $order->priority->getTime());
38 public function position($id) {
39 if($this->rowDetails === null) {
42 return $this->rowDetails->get($id)->position;
44 public function setMode($action) {
45 $this->mode = ScheduleParameters_0($this, $action);
50 public function __call($m, $a) {
51 if(isset($this->$m) && is_callable($this->$m))
52 return call_user_func_array($this->$m, $a);
53 else if(isset($this->»dynamics[$m]) && is_callable($this->»dynamics[$m]))
54 return call_user_func_array($this->»dynamics[$m], $a);
55 else if('toString' == $m)
56 return $this->__toString();
58 throw new HException('Unable to call «'.$m.'»');
60 function __toString() { return 'ScheduleParameters'; }
62 function ScheduleParameters_0(&$»this, &$action) {
65 return ScheduleMode::$Update;
68 return ScheduleMode::$Cancel;
71 return ScheduleMode::$Move;