class/baseObjectHandler.php 1 location
|
@@ 262-274 (lines=13) @@
|
259 |
|
* @return bool FALSE if update failed |
260 |
|
* @access public |
261 |
|
*/ |
262 |
|
public function updateAll($fieldname, $fieldvalue, $criteria = null) |
263 |
|
{ |
264 |
|
$set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->_db->quoteString($fieldvalue); |
265 |
|
$sql = 'UPDATE ' . $this->_db->prefix($this->_dbtable) . ' SET ' . $set_clause; |
266 |
|
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
267 |
|
$sql .= ' ' . $criteria->renderWhere(); |
268 |
|
} |
269 |
|
if (!$result = $this->_db->query($sql)) { |
270 |
|
return false; |
271 |
|
} |
272 |
|
|
273 |
|
return true; |
274 |
|
} |
275 |
|
|
276 |
|
/** |
277 |
|
* @param $obj |
class/file.php 1 location
|
@@ 699-712 (lines=14) @@
|
696 |
|
* |
697 |
|
* @return bool |
698 |
|
**/ |
699 |
|
public function updateAll($fieldname, $fieldvalue, $criteria = null) |
700 |
|
{ |
701 |
|
$set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue); |
702 |
|
$sql = 'UPDATE ' . $this->db->prefix('smartpartner_files') . ' SET ' . $set_clause; |
703 |
|
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
704 |
|
$sql .= ' ' . $criteria->renderWhere(); |
705 |
|
} |
706 |
|
//echo "<br>" . $sql . "<br>"; |
707 |
|
if (!$result = $this->db->queryF($sql)) { |
708 |
|
return false; |
709 |
|
} |
710 |
|
|
711 |
|
return true; |
712 |
|
} |
713 |
|
} |
714 |
|
|
class/partner.php 1 location
|
@@ 1254-1266 (lines=13) @@
|
1251 |
|
* @param bool $force |
1252 |
|
* @return bool |
1253 |
|
*/ |
1254 |
|
public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false) |
1255 |
|
{ |
1256 |
|
$set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue); |
1257 |
|
$sql = 'UPDATE ' . $this->db->prefix('smartpartner_partner') . ' SET ' . $set_clause; |
1258 |
|
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
1259 |
|
$sql .= ' ' . $criteria->renderWhere(); |
1260 |
|
} |
1261 |
|
if (!$result = $this->db->queryF($sql)) { |
1262 |
|
return false; |
1263 |
|
} |
1264 |
|
|
1265 |
|
return true; |
1266 |
|
} |
1267 |
|
|
1268 |
|
/** |
1269 |
|
* @param int $limit |