This commit is contained in:
parent
c67cd12226
commit
e47a72d3ce
@ -50,10 +50,6 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
||||
* @var integer $identifierType the type of identifier this table uses
|
||||
*/
|
||||
private $identifierType;
|
||||
/**
|
||||
* @var string $query cached simple query
|
||||
*/
|
||||
private $query;
|
||||
/**
|
||||
* @var Doctrine_Connection $conn Doctrine_Connection object that created this table
|
||||
*/
|
||||
@ -70,17 +66,16 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
||||
* @var array $columns an array of column definitions,
|
||||
* keys as column names and values as column definitions
|
||||
*
|
||||
* the value array has three values:
|
||||
* the definition array has atleast the following values:
|
||||
*
|
||||
* the column type, eg. 'integer'
|
||||
* the column length, eg. 11
|
||||
* the column options/constraints/validators. eg array('notnull' => true)
|
||||
* -- type the column type, eg. 'integer'
|
||||
* -- length the column length, eg. 11
|
||||
*
|
||||
* so the full columns array might look something like the following:
|
||||
* array(
|
||||
* 'name' => array('string', 20, array('notnull' => true, 'default' => 'someone')),
|
||||
* 'age' => array('integer', 11, array('notnull' => true))
|
||||
* )
|
||||
* additional keys:
|
||||
* -- notnull whether or not the column is marked as notnull
|
||||
* -- values enum values
|
||||
* -- notblank notblank validator + notnull constraint
|
||||
* ... many more
|
||||
*/
|
||||
protected $columns = array();
|
||||
/**
|
||||
@ -1133,27 +1128,6 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
/**
|
||||
* returns the maximum primary key value
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
final public function getMaxIdentifier()
|
||||
{
|
||||
$sql = "SELECT MAX(".$this->getIdentifier().") FROM ".$this->getTableName();
|
||||
$stmt = $this->conn->getDBH()->query($sql);
|
||||
$data = $stmt->fetch(PDO::FETCH_NUM);
|
||||
return isset($data[0])? $data[0] : 1;
|
||||
}
|
||||
/**
|
||||
* returns simple cached query
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQuery()
|
||||
{
|
||||
return $this->query;
|
||||
}
|
||||
/**
|
||||
* returns internal data, used by Doctrine_Record instances
|
||||
* when retrieving data from database
|
||||
|
Loading…
x
Reference in New Issue
Block a user