Bolt\Storage\Mapping\ContentTypeTitleTrait::getTitleColumnName PHP Метод

getTitleColumnName() защищенный Метод

Get the likely column name of the title.
protected getTitleColumnName ( Bolt\Storage\Mapping\ContentType | array $contentType ) : array
$contentType Bolt\Storage\Mapping\ContentType | array
Результат array
    protected function getTitleColumnName($contentType)
    {
        $fields = $contentType['fields'];
        $names = ['title', 'name', 'caption', 'subject', 'titel', 'naam', 'onderwerp', 'nom', 'sujet', 'nombre', 'sujeto', 'titulo', 'nome', 'subtitulo', 'assunto'];
        foreach ($fields as $name => $values) {
            if (in_array($name, $names)) {
                return $name;
            }
        }
        foreach ($fields as $name => $values) {
            if ($values['type'] === 'text') {
                return $name;
            }
        }
        // If this is a contenttype without any textfields
        $keys = array_keys($fields);
        return reset($keys);
    }
ContentTypeTitleTrait