/** * Get the list of require method * @return array */ public function listRequiredMethod() { if (!is_null($this->listRequiredMethod)) { return $this->listRequiredMethod; } $columns = $this->listColumns(); $methodList = array(); foreach ($columns as $name => $schema) { $methodList['get' . Utils::capitalize($name)] = array('type' => self::GETTER, 'column' => $name); switch ($schema['type']) { case 'array': $methodList['add' . Utils::Capitalize($name)] = array('type' => self::ADDER, 'column' => $name); $methodList['remove' . Utils::Capitalize($name)] = array('type' => self::REMOVER, 'column' => $name); break; case 'string': $methodList['set' . Utils::Capitalize($name)] = array('type' => self::SETTER, 'column' => $name); break; case 'entity': $methodList['add' . Utils::Capitalize($name)] = array('type' => self::ADDER, 'column' => $name); $methodList['remove' . Utils::Capitalize($name)] = array('type' => self::REMOVER, 'column' => $name); break; } } $this->listRequiredMethod = $methodList; return $methodList; }
protected function methodSetter(array &$methodList, $name) { $methodList['set' . Utils::Capitalize($name)] = array('type' => self::SETTER, 'column' => $name); }