public $score; // float
public $created; // datetime
- /**
- * Get an instance by key
- *
- * @param string $k Key to use to lookup (usually 'notice_id' for this class)
- * @param mixed $v Value to lookup
- *
- * @return Spam_score object found, or null for no hits
- *
- */
- function staticGet($k, $v=null)
- {
- return Managed_DataObject::staticGet('Spam_score', $k, $v);
- }
-
function saveNew($notice, $result) {
$score = new Spam_score();
function save($notice, $result) {
$orig = null;
- $score = Spam_score::staticGet('notice_id', $notice->id);
+ $score = Spam_score::getKV('notice_id', $notice->id);
if (empty($score)) {
$score = new Spam_score();
if ($score->find()) {
while ($score->fetch()) {
- $notice = Notice::staticGet('id', $score->notice_id);
+ $notice = Notice::getKV('id', $score->notice_id);
if (!empty($notice)) {
$orig = clone($score);
$score->notice_created = $notice->created;