public static function anonymous() { if ($cached = JsonStore::cached('User', 'anonymous')) { return $cached; } return JsonStore::setCached('User', 'anonymous', self::create((object) array("name" => "anonymous", "username" => $_SERVER['REMOTE_ADDR']))); }
public static function search($schema = NULL, $orderBy = NULL) { if (!$schema) { $schema = new StdClass(); } if (!$orderBy) { $orderBy = array("integer\\/id" => 'ASC'); } $results = JsonStore::schemaSearch('Idea', $schema, $orderBy); foreach ($results as $idx => $result) { if ($cached = JsonStore::cached('Idea', $result->id)) { $results[$idx] = $cached; continue; } $results[$idx] = JsonStore . setCached('Idea', $result->id, new Idea($result)); } return $results; }