-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfiguration.php
47 lines (38 loc) · 1.33 KB
/
Configuration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* Created by PhpStorm.
* User: bwalleshauser
* Date: 4/28/2015
* Time: 6:39 PM
*/
class Mainstreethost_GatorTraxBoatBuilder_Model_Json_Configuration
extends Mainstreethost_GatorTraxBoatBuilder_Model_Json_Abstract
implements Mainstreethost_GatorTraxBoatBuilder_Model_Json_IAutojson
{
private $id;
private $name;
private $optionId;
private $optionValueId;
private $rules;
public function __construct()
{
$this->rules = array();
}
public function Hydrate($configuration)
{
$this->id = (int)$configuration->getConfigurationId();
$this->name = Mage::helper('gator')->GetOptionValueNameFromId($configuration->getOptionId(),$configuration->getOptionValueId()) . ' ' . Mage::helper('gator')->GetOptionNameFromId($configuration->getOptionId());
$this->optionId = $configuration->getOptionId();
$this->optionValueId = $configuration->getOptionValueId();
$rules = Mage::getModel('pc/rule')->LoadByConfigurationId($configuration->getConfigurationId());
foreach ($rules as $rule)
{
array_push($this->rules,Mage::getModel('gator/Json_Rule')->Hydrate($rule));
}
return $this;
}
public function get($member)
{
return $this->$member;
}
}