Esempio n. 1
0
 /**
  * Registers a custom DQL function that produces a date/time value.
  * Such a function can then be used in any DQL statement in any place where date/time
  * functions are allowed.
  *
  * DQL function names are case-insensitive.
  *
  * @param string $name
  * @param string $className
  *
  * @return void
  *
  * @throws ORMException
  */
 public function addCustomDatetimeFunction($name, $className)
 {
     if (Query\Parser::isInternalFunction($name)) {
         throw ORMException::overwriteInternalDQLFunctionNotAllowed($name);
     }
     $this->_attributes['customDatetimeFunctions'][strtolower($name)] = $className;
 }