Commit 5d3fcfb8 authored by Bastian Waidelich's avatar Bastian Waidelich Committed by Felix Oertel
Browse files

[+BUGFIX] Revert incorrect deletion of Query::count() & Query::withUid()

The methods Tx_Extbase_Persistence_Query::count() and
Tx_Extbase_Persistence_Query::withUid() are deprecated.
They have been removed in
Ic1b6217bc6c9100b6c48c5d30eca6068417265a8.

But the deletion is incomplete and leads to a fatal error
We'll have to keep count() until version 1.5 according to the
TYPO3 release policy.

WithUid() is already deprecated since extbase 1.2 so it could
be removed with 1.4. But it has to be removed from the interface
and from all parts in the core that are still using it (currently two)

Relates: #13745

Change-Id: I390edfe3de1fe92a27723dcccdd6a6d098f5ac07
parent 810f4308
......@@ -226,6 +226,17 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
}
}
/**
* Executes the number of matching objects for the query
*
* @return integer The number of matching objects
* @deprecated since Extbase 1.3.0; was removed in FLOW3; will be removed in Extbase 1.5.0; use Query::execute()::count() instead
*/
public function count() {
t3lib_div::logDeprecatedFunction();
return $this->persistenceManager->getObjectCountByQuery($this);
}
/**
* Sets the property names to order the result by. Expected like this:
* array(
......@@ -416,6 +427,22 @@ class Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_QueryInterf
return $this->qomFactory->not($constraint);
}
/**
* Matches against the (internal) uid.
*
* @param int $uid The uid to match against
* @return Tx_Extbase_Persistence_QOM_ComparisonInterface
* @deprecated since Extbase 1.2.0; was removed in FLOW3; will be removed in Extbase 1.4.0; use equals() instead
*/
public function withUid($operand) {
t3lib_div::logDeprecatedFunction();
return $this->qomFactory->comparison(
$this->qomFactory->propertyValue('uid', $this->getSelectorName()),
Tx_Extbase_Persistence_QueryInterface::OPERATOR_EQUAL_TO,
$operand
);
}
/**
* Returns an equals criterion used for matching objects against a query
*
......
......@@ -122,7 +122,7 @@ interface Tx_Extbase_Persistence_QueryInterface {
* Executes the query against the database and returns the number of matching objects
*
* @return integer The number of matching objects
* @api
* @deprecated since Extbase 1.3.0; was removed in FLOW3; will be removed in Extbase 1.5.0
*/
public function count();
......@@ -201,7 +201,7 @@ interface Tx_Extbase_Persistence_QueryInterface {
*
* @param string $uid An identifier to match against
* @return object
* @api
* @deprecated since Extbase 1.2.0; was removed in FLOW3; will be removed in Extbase 1.4.0; use equals() instead
*/
public function withUid($uid);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment