public static function setModelFieldList($data, $type = "AR", $class = "") { if (count(FormsController::$modelFieldList) == 0) { if ($type == "AR") { FormsController::$modelFieldList = $data; $rel = isset($data['Relations']) ? $data['Relations'] : array(); FormsController::$relFieldList = array_merge(array('' => '-- None --', '---' => '---', 'currentModel' => 'Current Model', '--' => '---'), $rel); } else { foreach ($data as $name => $field) { FormsController::$modelFieldList[$name] = $name; } unset(FormsController::$modelFieldList['type']); } } }