refactored MongoModel to hide fetch method, fixed PHPDoc errors

This commit is contained in:
Anton Grebnev
2012-10-19 20:15:26 +04:00
parent efb6c2d34c
commit 11a5968105
14 changed files with 436 additions and 187 deletions

View File

@ -10,6 +10,9 @@
* @since 2011-11-11
*/
/**
* @property SqlDbDriver $db
*/
abstract class SqlModel extends Model
{
@ -105,8 +108,10 @@ abstract class SqlModel extends Model
/**
* This method appends to params table and primary key.
* So they can be accessed thru `:table` and `:pk` placeholders.
* So they can be accessed through `:table` and `:pk` placeholders.
*
* @param string $sql
* @param array $params
* @return DbStatement
*/
protected function query($sql, $params = array())
@ -122,10 +127,11 @@ abstract class SqlModel extends Model
}
/**
* @param string $sql
* @param array $params
* @param string $field
* @param CacheKey $cache_key
* @param string $data Request
* @param array $params Request parameters
* @param string $field Requested field name
* @param CacheKey $cache_key Key for caching in
* @return mixed
*/
protected function fetchField($data, $params = array(), $field, $cache_key = null)
{
@ -139,9 +145,10 @@ abstract class SqlModel extends Model
}
/**
* @param string $sql
* @param array $params
* @param CacheKey $cache_key
* @param string $data Request
* @param array $params Request parameters
* @param CacheKey $cache_key Key for caching in
* @return mixed
*/
protected function fetch($data, $params = array(), $cache_key = null)
{
@ -155,9 +162,10 @@ abstract class SqlModel extends Model
}
/**
* @param string $sql
* @param string $data
* @param array $params
* @param CacheKey $cache_key
* @return array
*/
protected function fetchAll($data, $params = array(), $cache_key = null)
{