Пример #1
0
 public function exist($args, $compare = null)
 {
     $row = instance::one($this->read(), "select * from %t where " . instance::implode($args, 'AND'), [$this->table()]);
     if (empty($row)) {
         return false;
     } else {
         if (!$compare) {
             return true;
         } else {
             foreach ($compare as $k => $v) {
                 if ($row[$k] != $v) {
                     return true;
                 }
             }
             return false;
         }
     }
 }