Doctrine\OXM\Util\Inflector::xmlize PHP Method

xmlize() public static method

Convert word to the format for an xml element. Converts XxxYYY to xxx-yyy
public static xmlize ( string $word ) : string
$word string Word to xmlize
return string $word Xmlized word
    public static function xmlize($word)
    {
        return strtolower(preg_replace('/([a-z])([A-Z])/', '$1-$2', $word));
    }

Usage Example

Example #1
0
 /**
  * Initializes a new ClassMetadata instance that will hold the object-document mapping
  * metadata of the class with the given name.
  *
  * @param string $entityName The name of the document class the new instance is used for.
  */
 public function __construct($entityName)
 {
     parent::__construct($entityName);
     $this->reflClass = new \ReflectionClass($entityName);
     $this->namespace = $this->reflClass->getNamespaceName();
     $this->xmlName = Inflector::xmlize($this->reflClass->getShortName());
 }
All Usage Examples Of Doctrine\OXM\Util\Inflector::xmlize
Inflector