Repository.php 703 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace MGModule\DNSManager2\models\custom\package\setting;
  3. use MGModule\DNSManager2 as main;
  4. /**
  5. * Description of repository
  6. *
  7. *
  8. */
  9. class Repository extends \MGModule\DNSManager2\mgLibs\models\repository{
  10. public function getModelClass() {
  11. return __NAMESPACE__.'\PackageSetting';
  12. }
  13. public function byPackageID($packageid) {
  14. return $this->setFilter('packageid', $packageid);
  15. }
  16. public function byKey($key) {
  17. return $this->setFilter('key', $key);
  18. }
  19. public function getWithKeys() {
  20. $out = array();
  21. foreach($this->get() as $setting)
  22. $out[$setting->key] = $setting;
  23. return $out;
  24. }
  25. }