query = $this->loadService(UserPointSaleRepositoryQuery::class); } public function getDefaultOptionsSearch(): array { return [ 'with' => [], 'join_with' => [], 'orderby' => '', 'attribute_id_producer' => '' ] ; } public function findUserPointSalesByUser(User $user): array { return UserPointSale::searchAll([ 'id_user' => $user->id ]); } public function findOneUserPointSale(User $user = null, PointSale $pointSale = null) { if(!$user || !$pointSale) { return null; } return UserPointSale::find() ->where([ 'id_user' => $user->id, 'id_point_sale' => $pointSale->id ])->one(); } }