Jarves\Admin\FieldTypes\ColumnDefinition::setPhpDataType PHP Method

setPhpDataType() public method

public setPhpDataType ( string $phpDataType )
$phpDataType string
    public function setPhpDataType($phpDataType)
    {
        $this->phpDataType = $phpDataType;
    }

Usage Example

 /**
  * @return ColumnDefinitionInterface[]
  */
 public function getColumns()
 {
     $columnDefinition = new ColumnDefinition();
     $columnDefinition->setPhpDataType($this->getPhpDataType());
     $type = $this->getSqlDataType();
     if ($maxLength = $this->getFieldDefinition()->getMaxLength()) {
         $type .= '(' . $maxLength . ')';
     }
     $columnDefinition->setSqlDataType($type);
     $columnDefinition->setName($this->getFieldDefinition()->getId());
     if ($regex = $this->getFieldDefinition()->getRequiredRegex()) {
         $columnDefinition->setRequiredRegex($regex);
     }
     return [$columnDefinition];
 }