Pheasant\Database\MysqlPlatform::_options PHP Method

_options() private method

Returns mysql column options for a given {@link Options}
private _options ( $options ) : string
return string
    private function _options($options)
    {
        $result = array();
        // certain parameters have to occur first
        if (isset($options->unsigned)) {
            $result[] = 'unsigned';
        }
        if (isset($options->zerofill)) {
            $result[] = 'zerofill';
        }
        foreach ($options as $key => $value) {
            switch ($key) {
                case 'primary':
                    $result[] = 'primary key';
                    break;
                case 'required':
                case 'notnull':
                    $result[] = 'not null';
                    break;
                case 'default':
                    $result[] = sprintf("default '%s'", $value);
                    break;
                case 'sequence':
                case 'unsigned':
                case 'zerofill':
                case 'allowed':
                    break;
                default:
                    $result[] = $key;
                    break;
            }
        }
        return implode(' ', $result);
    }