public function constraint($type, $columnName, $options = array()) { $index = $this->indexOfConstraint($type, $columnName); if ($index > -1) { $constraint = $this->constraints[$index]; } else { $string = new Midori_String($type); $class = "Midori_Data_" . $string->camelize() . "Constraint"; $tableAlias = is_null($this->tableAlias) ? $this->tableName : $this->tableAlias; $constraint = new $class($this->tableName, $tableAlias, $columnName); } $constraint->send($options); if ($index == -1) { $this->constraints->add($constraint); } }
private static function _load($fixture) { $string = new Midori_String($fixture); if ($string->startsWith("_config.")) { $class = ""; $path = self::$fixturesFilePath . "{$string->toString(false)}.php"; } else { $class = $string->camelize(); $path = self::$fixturesFilePath . $fixture . ".php"; } self::parse($path); }