<?php

namespace MGModule\DNSManager2\models\custom\package\setting;
use MGModule\DNSManager2 as main;

/**
 * Description of repository
 *
 * 
 */
class Repository extends \MGModule\DNSManager2\mgLibs\models\repository{   
    public function getModelClass() {
        return __NAMESPACE__.'\PackageSetting';
    }
    
    public function byPackageID($packageid) {
        return $this->setFilter('packageid', $packageid);
    }
    
    public function byKey($key) {
        return $this->setFilter('key', $key);
    }
    
    public function getWithKeys() {
        $out = array();
        foreach($this->get() as $setting)
            $out[$setting->key] = $setting;
        return $out; 
    }
}
