You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CreditHistoryRepository.php 712B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace common\logic\User\CreditHistory;
  3. use common\logic\AbstractService;
  4. use common\logic\Order\Order\Order;
  5. use common\logic\RepositoryInterface;
  6. class CreditHistoryRepository extends AbstractService implements RepositoryInterface
  7. {
  8. public function getDefaultOptionsSearch(): array
  9. {
  10. return [
  11. 'with' => [],
  12. 'join_with' => [],
  13. 'orderby' => CreditHistory::tableName() . '.date ASc',
  14. 'attribute_id_producer' => CreditHistory::tableName() . '.id_producer'
  15. ];
  16. }
  17. public function getByOrder(Order $order)
  18. {
  19. return CreditHistory::find()
  20. ->where(['id_order' => $order->id])
  21. ->all();
  22. }
  23. }