getDatabaseField() public method

public getDatabaseField ( $field )
Esempio n. 1
0
 /**
  * Add a single column to the ContentType table.
  *
  * @param \Bolt\Storage\Database\Schema\Table\ContentType $tableObj
  * @param \Doctrine\DBAL\Schema\Table                     $table
  * @param string                                          $fieldName
  * @param array                                           $values
  * @param FieldManager                                    $fieldManager
  */
 private function addContentTypeTableColumn(ContentType $tableObj, Table $table, $fieldName, array $values, FieldManager $fieldManager)
 {
     if ($tableObj->isKnownType($values['type'])) {
         // Use loose comparison on true as 'true' in YAML is a string
         $addIndex = isset($values['index']) && (bool) $values['index'] === true;
         // Add the contenttype's specific fields
         $tableObj->addCustomFields($fieldName, $this->getContentTypeTableColumnType($values), $addIndex);
     } elseif ($handler = $fieldManager->getDatabaseField($values['type'])) {
         // Add template fields
         /** @var $handler \Bolt\Storage\Field\FieldInterface */
         $table->addColumn($fieldName, $handler->getStorageType(), $handler->getStorageOptions());
     }
 }