lithium\data\source\Database::_meta()

protected method

Build a SQL column/table meta.

Parameters

  • string $type

    The type of the meta to build (possible values: 'table' or 'column').

  • string $name

    The name of the meta to build.

  • mixed $value

    The value used for building the meta.

Returns

string

The SQL meta string.

Source

	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 += ['keyword' => '', 'escape' => false, 'join' => ' '];

		if ($meta['escape'] === true) {
			$value = $this->value($value, ['type' => 'string']);
		}
		return ($result = "{$meta['keyword']}{$meta['join']}{$value}") !== ' ' ? $result : '';
	}