1
0
Fork 0
mirror of synced 2024-06-26 10:10:57 +12:00

perf(database): move filter status to parent method

This commit is contained in:
Torsten Dittmann 2021-02-01 11:24:52 +01:00
parent d94c854215
commit 619f803aab

View file

@ -475,6 +475,10 @@ class Database
public function encode(Document $document):Document
{
if (!self::$statusFilters) {
return $document;
}
$collection = $this->getDocument($document->getCollection(), true , false);
$rules = $collection->getAttribute('rules', []);
@ -511,6 +515,10 @@ class Database
public function decode(Document $document):Document
{
if (!self::$statusFilters) {
return $document;
}
$collection = $this->getDocument($document->getCollection(), true , false);
$rules = $collection->getAttribute('rules', []);
@ -553,10 +561,6 @@ class Database
*/
static protected function encodeAttribute(string $name, $value)
{
if (!self::$statusFilters) {
return $value;
}
if (!isset(self::$filters[$name])) {
return $value;
throw new Exception('Filter not found');
@ -579,10 +583,6 @@ class Database
*/
static protected function decodeAttribute(string $name, $value)
{
if (!self::$statusFilters) {
return $value;
}
if (!isset(self::$filters[$name])) {
return $value;
throw new Exception('Filter not found');