private function addSearchInDb(\Nethgui\System\PlatformInterface $platform, $text, $where)
 {
     $filter = NULL;
     if ($text) {
         $filter = function ($key, $props) use($text) {
             if (strstr(strtolower($key), strtolower($text)) !== FALSE) {
                 return TRUE;
             }
             foreach ($props as $p => $v) {
                 if (strstr(strtolower($v), strtolower($text)) !== FALSE) {
                     return TRUE;
                 }
             }
             return FALSE;
         };
     }
     foreach ($where as $dbName => $types) {
         foreach ($platform->getTableAdapter($dbName, $types, $filter) as $key => $props) {
             if (isset($props['type'])) {
                 $type = $props['type'];
                 unset($props['type']);
             } else {
                 $type = $types[0];
             }
             $this->results->append(new \NethServer\Tool\FirewallObject($key, $type, $props, $this->translator));
         }
     }
 }
Ejemplo n.º 2
0
 public function __construct(\Nethgui\System\PlatformInterface $p)
 {
     $this->platform = $p;
     $this->innerAdapter = $this->platform->getTableAdapter('networks', 'network');
     parent::__construct(array($this, 'readTable'));
 }