lithium\data\source\database\adapter\Sqlite3::sources()

public method

Returns the list of tables in the currently-connected database.

Parameters

  • string $model

    The fully-name-spaced class name of the model object making the request.

Returns

array

Returns an array of objects to which models can connect.

Filter

This method can be filtered.

Source

	public function sources($model = null) {
		$config = $this->_config;

		return $this->_filter(__METHOD__, compact('model'), function($self, $params) use ($config) {
			$sql = "SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;";
			$result = $self->invokeMethod('_execute', array($sql));
			$sources = array();

			foreach ($result as $row) {
				$sources[] = $row[0];
			}
			return $sources;
		});
	}