Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
3056d9da
Commit
3056d9da
authored
Jul 23, 2006
by
doctrine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new method: Doctrine_Table::count(), returns the number of records in specified table
parent
95bd6100
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
Hydrate.php
Doctrine/Hydrate.php
+2
-0
Table.php
Doctrine/Table.php
+10
-1
No files found.
Doctrine/Hydrate.php
View file @
3056d9da
<?php
<?php
Doctrine
::
autoload
(
'Doctrine_Access'
);
class
Doctrine_Hydrate
extends
Doctrine_Access
{
class
Doctrine_Hydrate
extends
Doctrine_Access
{
/**
/**
* @var array $fetchmodes an array containing all fetchmodes
* @var array $fetchmodes an array containing all fetchmodes
...
...
Doctrine/Table.php
View file @
3056d9da
...
@@ -14,7 +14,7 @@ require_once("Configurable.php");
...
@@ -14,7 +14,7 @@ require_once("Configurable.php");
* @license LGPL
* @license LGPL
* @version 1.0 alpha
* @version 1.0 alpha
*/
*/
class
Doctrine_Table
extends
Doctrine_Configurable
{
class
Doctrine_Table
extends
Doctrine_Configurable
implements
Countable
{
/**
/**
* @var boolean $isNewEntry whether ot not this table created a new record or not, used only internally
* @var boolean $isNewEntry whether ot not this table created a new record or not, used only internally
*/
*/
...
@@ -778,6 +778,15 @@ class Doctrine_Table extends Doctrine_Configurable {
...
@@ -778,6 +778,15 @@ class Doctrine_Table extends Doctrine_Configurable {
final
public
function
getTableDescription
()
{
final
public
function
getTableDescription
()
{
return
$this
->
columns
;
return
$this
->
columns
;
}
}
/**
* count
*
* @return integer
*/
public
function
count
()
{
$a
=
$this
->
session
->
getDBH
()
->
query
(
"SELECT COUNT(1) FROM "
.
$this
->
tableName
)
->
fetch
(
PDO
::
FETCH_NUM
);
return
current
(
$a
);
}
/**
/**
* @return Doctrine_Query a Doctrine_Query object
* @return Doctrine_Query a Doctrine_Query object
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment