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

_buildMetas() protected method

Helper for building columns metas
See also: lithium\data\soure\Database::createSchema()
See also: lithium\data\soure\Database::column()
protected _buildMetas ( $type, array $metas, array $names = null, type $joiner = ' ' ) : string
$metas array The array of column metas.
$names array If `$names` is not `null` only build meta present in `$names`
$joiner type The join character
return string The SQL constraints
    protected function _buildMetas($type, array $metas, $names = null, $joiner = ' ')
    {
        $result = '';
        $names = $names ? (array) $names : array_keys($metas);
        foreach ($names as $name) {
            $value = isset($metas[$name]) ? $metas[$name] : null;
            if ($value && ($meta = $this->_meta($type, $name, $value))) {
                $result .= $joiner . $meta;
            }
        }
        return $result;
    }