Bolt\Legacy\Storage::getContentTypeFieldType PHP 메소드

getContentTypeFieldType() 공개 메소드

Get the fieldtype for a given contenttype and fieldname.
public getContentTypeFieldType ( string $contenttypeslug, string $fieldname ) : array
$contenttypeslug string
$fieldname string
리턴 array $fields
    public function getContentTypeFieldType($contenttypeslug, $fieldname)
    {
        $contenttype = $this->getContentType($contenttypeslug);
        if (in_array($fieldname, ['datecreated', 'datechanged', 'datepublish', 'datedepublish'])) {
            return "datetime";
        } elseif (isset($contenttype['fields'][$fieldname]['type'])) {
            return $contenttype['fields'][$fieldname]['type'];
        } else {
            return false;
        }
    }