Doctrine\ODM\CouchDB\Types\Type::addType PHP Метод

addType() публичный статический Метод

Adds a custom type to the type map.
public static addType ( string $name, string $className )
$name string Name of the type. This should correspond to what getName() returns.
$className string The class name of the custom type.
    public static function addType($name, $className)
    {
        if (isset(self::$_typesMap[$name])) {
            throw TypeException::typeExists($name);
        }
        self::$_typesMap[$name] = $className;
    }

Usage Example

Пример #1
0
 public function testAddExistantType()
 {
     $this->setExpectedException("Doctrine\\ODM\\CouchDB\\Types\\TypeException");
     Type::addType('mixed', 'Doctrine\\ODM\\CouchDB\\Types\\MixedType');
 }