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"); } }
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]; }