public static function find($fields = ['*'], $params = []) { $db = Connection::getConnection(); $params['mail.id'] = 'link.messageId'; $result = $db->find($fields, $params, 'mail, link'); $result->rowCount() == 1 ? $r = $result->fetch(PDO::FETCH_OBJ) : ($r = $result->fetchAll(PDO::FETCH_OBJ)); return $r; }
public static function translate($code, $language) { $converters = \Ptut\App\Model\Connection::getConnection()->query("" . "Select layout.code as layout, translation.code as translation " . "from layout, translation " . "where layout.id = translation.layoutId and translation.language = (?)", [$language]); $converters = $converters->fetchAll(PDO::FETCH_OBJ); foreach ($converters as $converter) { $converter->layout = Translator::interpret($converter->layout); //debug($converter->layout); } foreach ($converters as $converter) { $code = preg_replace($converter->layout, $converter->translation, $code); } //$code = preg_replace('#(^|\n)(?!/{3})(.*)\n#m', "Erreur de syntaxe\n", $code); //$code = preg_replace('#///#m', '', $code); return $code; }
public static function delete($params) { $db = Connection::getConnection(); $result = $db->delete($params, 'function'); return $result; }
public static function update($values, $params) { $db = Connection::getConnection(); $result = $db->update($values, $params, 'user'); return $result; }