Skip to content

Commit

Permalink
ajustes
Browse files Browse the repository at this point in the history
  • Loading branch information
webcrud committed Sep 11, 2021
1 parent 681c1de commit 183eb16
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Business/Region/Repository/RegionCityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace AnexusPHP\Business\Region\Repository;

use AnexusPHP\Business\Region\Entity\RegionCityEntity;
use AnexusPHP\Business\Region\Entity\RegionStateEntity;
use AnexusPHP\Core\Database;
use Exception;
use PDO;
Expand Down Expand Up @@ -72,4 +73,16 @@ public static function searchAll()
$db = Database::getInstance();
return $db->query('select * from ' . RegionCityEntity::TABLE . ' where trash = 0')->fetchAll(PDO::FETCH_CLASS, RegionCityEntity::class);
}

/**
* Undocumented function
*
* @param RegionStateEntity $state
* @return RegionCityEntity[]
*/
public static function byState(RegionStateEntity $state)
{
$db = Database::getInstance();
return $db->query('select * from ' . RegionCityEntity::TABLE . ' where state_id = :state_id', ['state_id' => $state->getId()])->fetchAll(PDO::FETCH_CLASS, RegionCityEntity::class);
}
}

0 comments on commit 183eb16

Please sign in to comment.