| @@ 30-38 (lines=9) @@ | ||
| 27 | /** |
|
| 28 | * {@inheritDoc} |
|
| 29 | */ |
|
| 30 | public function findBy(array $criteria, array $sort = null, $limit = null, $skip = null) |
|
| 31 | { |
|
| 32 | if (!array_key_exists('isDraft', $criteria)) { |
|
| 33 | $criteria['isDraft'] = false; |
|
| 34 | } elseif (null === $criteria['isDraft']) { |
|
| 35 | unset($criteria['isDraft']); |
|
| 36 | } |
|
| 37 | return parent::findBy($criteria, $sort, $limit, $skip); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * {@inheritDoc} |
|
| @@ 25-36 (lines=12) @@ | ||
| 22 | */ |
|
| 23 | trait DraftableEntityAwareTrait |
|
| 24 | { |
|
| 25 | public function findBy(array $criteria, array $sort = null, $limit = null, $skip = null) |
|
| 26 | { |
|
| 27 | if (!array_key_exists('isDraft', $criteria)) { |
|
| 28 | $criteria['isDraft'] = false; |
|
| 29 | } elseif (null === $criteria['isDraft']) { |
|
| 30 | unset($criteria['isDraft']); |
|
| 31 | } |
|
| 32 | ||
| 33 | /** @noinspection PhpUndefinedClassInspection */ |
|
| 34 | /** @noinspection PhpUndefinedMethodInspection */ |
|
| 35 | return parent::findBy($criteria, $sort, $limit, $skip); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * Find entities in draft mode. |
|