lithium\data\source\Database::_meta PHP Method

_meta() protected method

Build a SQL column/table meta.
protected _meta ( string $type, string $name, mixed $value ) : string
$type string The type of the meta to build (possible values: `'table'` or `'column'`).
$name string The name of the meta to build.
$value mixed The value used for building the meta.
return string The SQL meta string.
    protected function _meta($type, $name, $value)
    {
        $meta = isset($this->_metas[$type][$name]) ? $this->_metas[$type][$name] : null;
        if (!$meta || isset($meta['options']) && !in_array($value, $meta['options'])) {
            return;
        }
        $meta += array('keyword' => '', 'escape' => false, 'join' => ' ');
        if ($meta['escape'] === true) {
            $value = $this->value($value, array('type' => 'string'));
        }
        return ($result = "{$meta['keyword']}{$meta['join']}{$value}") !== ' ' ? $result : '';
    }