Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating doc blocks in Datasource. Adding missing reference operators.

  • Loading branch information...
commit 13ffcbc0ba96d55217949484ba143c9d83761c9c 1 parent 7387cfd
@markstory markstory authored
Showing with 52 additions and 19 deletions.
  1. +52 −19 cake/libs/model/datasources/datasource.php
View
71 cake/libs/model/datasources/datasource.php
@@ -78,6 +78,7 @@ class DataSource extends Object {
* The starting character that this DataSource uses for quoted identifiers.
*
* @var string
+ * @access public
*/
var $startQuote = null;
@@ -85,6 +86,7 @@ class DataSource extends Object {
* The ending character that this DataSource uses for quoted identifiers.
*
* @var string
+ * @access public
*/
var $endQuote = null;
@@ -199,11 +201,15 @@ class DataSource extends Object {
* should be cached
*
* @var boolean
+ * @access public
*/
var $cacheSources = true;
/**
* Constructor.
+ *
+ * @param array $config Array of configuration information for the datasource.
+ * @return void.
*/
function __construct($config = array()) {
parent::__construct();
@@ -213,7 +219,9 @@ function __construct($config = array()) {
/**
* Caches/returns cached results for child instances
*
- * @return array
+ * @param mixed $data
+ * @return array Array of sources available in this datasource.
+ * @access public
*/
function listSources($data = null) {
if ($this->cacheSources === false) {
@@ -240,7 +248,9 @@ function listSources($data = null) {
/**
* Convenience method for DboSource::listSources(). Returns source names in lowercase.
*
- * @return array
+ * @param boolean $reset Whether or not the source list should be reset.
+ * @return array Array of sources available in this datasource
+ * @access public
*/
function sources($reset = false) {
if ($reset === true) {
@@ -253,9 +263,10 @@ function sources($reset = false) {
* Returns a Model description (metadata) or null if none found.
*
* @param Model $model
- * @return mixed
+ * @return array Array of Metadata for the $model
+ * @access public
*/
- function describe($model) {
+ function describe(&$model) {
if ($this->cacheSources === false) {
return null;
}
@@ -276,6 +287,7 @@ function describe($model) {
* Begin a transaction
*
* @return boolean Returns true if a transaction is not in progress
+ * @access public
*/
function begin(&$model) {
return !$this->_transactionStarted;
@@ -285,6 +297,7 @@ function begin(&$model) {
* Commit a transaction
*
* @return boolean Returns true if a transaction is in progress
+ * @access public
*/
function commit(&$model) {
return $this->_transactionStarted;
@@ -294,6 +307,7 @@ function commit(&$model) {
* Rollback a transaction
*
* @return boolean Returns true if a transaction is in progress
+ * @access public
*/
function rollback(&$model) {
return $this->_transactionStarted;
@@ -304,6 +318,7 @@ function rollback(&$model) {
*
* @param string $real Real column type (i.e. "varchar(255)")
* @return string Abstract column type (i.e. "string")
+ * @access public
*/
function column($real) {
return false;
@@ -318,6 +333,7 @@ function column($real) {
* @param array $fields An Array of fields to be saved.
* @param array $values An Array of values to save.
* @return boolean success
+ * @access public
*/
function create(&$model, $fields = null, $values = null) {
return false;
@@ -331,6 +347,7 @@ function create(&$model, $fields = null, $values = null) {
* @param Model $model The model being read.
* @param array $queryData An array of query data used to find the data you want
* @return mixed
+ * @access public
*/
function read(&$model, $queryData = array()) {
return false;
@@ -345,6 +362,7 @@ function read(&$model, $queryData = array()) {
* @param array $fields Array of fields to be updated
* @param array $values Array of values to be update $fields to.
* @return boolean Success
+ * @access public
*/
function update(&$model, $fields = null, $values = null) {
return false;
@@ -357,6 +375,7 @@ function update(&$model, $fields = null, $values = null) {
*
* @param Model $model The model class having record(s) deleted
* @param mixed $id Primary key of the model
+ * @access public
*/
function delete(&$model, $id = null) {
if ($id == null) {
@@ -368,7 +387,8 @@ function delete(&$model, $id = null) {
* Returns the ID generated from the previous INSERT operation.
*
* @param unknown_type $source
- * @return in
+ * @return mixed Last ID key generated in previous INSERT
+ * @access public
*/
function lastInsertId($source = null) {
return false;
@@ -378,7 +398,8 @@ function lastInsertId($source = null) {
* Returns the ID generated from the previous INSERT operation.
*
* @param unknown_type $source
- * @return in
+ * @return integer Number of rows returned by last operation
+ * @access public
*/
function lastNumRows($source = null) {
return false;
@@ -388,7 +409,8 @@ function lastNumRows($source = null) {
* Returns the ID generated from the previous INSERT operation.
*
* @param unknown_type $source
- * @return in
+ * @return integer Number of rows affected by last query.
+ * @access public
*/
function lastAffected($source = null) {
return false;
@@ -400,6 +422,7 @@ function lastAffected($source = null) {
* before establishing a connection.
*
* @return boolean Whether or not the Datasources conditions for use are met.
+ * @access public
*/
function enabled() {
return true;
@@ -409,6 +432,7 @@ function enabled() {
*
* @param string $interface The name of the interface (method)
* @return boolean True on success
+ * @access public
*/
function isInterfaceSupported($interface) {
$methods = get_class_methods(get_class($this));
@@ -419,10 +443,12 @@ function isInterfaceSupported($interface) {
}
/**
- * Sets the configuration for the DataSource
+ * Sets the configuration for the DataSource.
+ * Merges the $config information with the _baseConfig and the existing $config property.
*
* @param array $config The configuration array
* @return void
+ * @access public
*/
function setConfig($config = array()) {
$this->config = array_merge($this->_baseConfig, $this->config, $config);
@@ -433,6 +459,8 @@ function setConfig($config = array()) {
*
* @param string $object The name of the object (model) to cache
* @param mixed $data The description of the model, usually a string or array
+ * @return mixed
+ * @access private
*/
function __cacheDescription($object, $data = null) {
if ($this->cacheSources === false) {
@@ -455,16 +483,18 @@ function __cacheDescription($object, $data = null) {
}
/**
- * Enter description here...
+ * Replaces `{$__cakeID__$}` and `{$__cakeForeignKey__$}` placeholders in query data.
*
- * @param unknown_type $query
- * @param unknown_type $data
- * @param unknown_type $association
+ * @param string $query Query string needing replacements done.
+ * @param array $data Array of data with values that will be inserted in placeholders.
+ * @param string $association Name of association model being replaced
* @param unknown_type $assocData
- * @param Model $model
- * @param Model $linkModel
+ * @param Model $model Instance of the model to replace $__cakeID__$
+ * @param Model $linkModel Instance of model to replace $__cakeForeignKey__$
* @param array $stack
- * @return unknown
+ * @return string String of query data with placeholders replaced.
+ * @access public
+ * @todo Remove and refactor $assocData, ensure uses of the method have the param removed too.
*/
function insertQueryData($query, $data, $association, $assocData, &$model, &$linkModel, $stack) {
$keys = array('{$__cakeID__$}', '{$__cakeForeignKey__$}');
@@ -538,17 +568,20 @@ function insertQueryData($query, $data, $association, $assocData, &$model, &$lin
/**
* To-be-overridden in subclasses.
*
- * @param unknown_type $model
- * @param unknown_type $key
- * @return unknown
+ * @param Model $model Model instance
+ * @param string $key Key name to make
+ * @return string Key name for model.
+ * @access public
*/
- function resolveKey($model, $key) {
+ function resolveKey(&$model, $key) {
return $model->alias . $key;
}
/**
* Closes the current datasource.
*
+ * @return void
+ * @access public
*/
function __destruct() {
if ($this->_transactionStarted) {
Please sign in to comment.
Something went wrong with that request. Please try again.