Beispiel #1
0
 public function setModelMap($modelMap)
 {
     unset($this->modelMap);
     Assert::notNull($modelMap, "modelMap must not be null");
     if (is_array($modelMap)) {
         $this->modelMap = new ModelMap($modelMap);
     } elseif ($modelMap instanceof ModelMap) {
         $this->modelMap = $modelMap;
     } else {
         throw new \InvalidArgumentException("Invalid ModelMap");
     }
 }
Beispiel #2
0
 public function get($attributeName)
 {
     Assert::notNull($attributeName, "Model attribute name must not be null");
     Assert::arrayNotHasKey($attributeName, $this->map, "this Model the not has '{$attributeName}'.");
     return $this->map[$attributeName];
 }