/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
-
- static function pivotGet($keyCol, $keyVals, $otherCols)
- {
- return Memcached_DataObject::pivotGet('Avatar', $keyCol, $keyVals, $otherCols);
- }
public static function schemaDef()
{
return parent::pkeyGetClass(get_called_class(), $kv);
}
+ /**
+ * Get multiple items from the database by key
+ *
+ * @param string $keyCol name of column for key
+ * @param array $keyVals key values to fetch
+ * @param array $otherCols Other columns to hold fixed
+ *
+ * @return array Array mapping $keyVals to objects, or null if not found
+ */
+ static function pivotGet($keyCol, array $keyVals, array $otherCols=array())
+ {
+ return parent::pivotGetClass(get_called_class(), $keyCol, $keyVals, $otherCols);
+ }
+
/**
* Get a multi-instance object
*
*/
function multiGet($cls, $keyCol, $keyVals, $skipNulls=true)
{
- $result = self::pivotGet($cls, $keyCol, $keyVals);
+ $result = self::pivotGetClass($cls, $keyCol, $keyVals);
$values = array_values($result);
*
* @return array Array mapping $keyVals to objects, or null if not found
*/
- static function pivotGet($cls, $keyCol, $keyVals, $otherCols = array())
+ static function pivotGetClass($cls, $keyCol, array $keyVals, array $otherCols = array())
{
if (!is_a($cls, __CLASS__, true)) {
throw new Exception('Trying to fetch ' . __CLASS__ . ' into a non-related class');
}
if (count($allPkeys) > 0) {
- $keyResults = self::pivotGet($cls, $pkeyCols, $allPkeys);
+ $keyResults = self::pivotGetClass($cls, $pkeyCols, $allPkeys);
foreach ($pkeyMap as $keyVal => $pkeyList) {
foreach ($pkeyList as $pkeyVal) {
$ids = array_unique($ids);
- return Memcached_DataObject::pivotGet('Profile', 'id', $ids);
+ return Profile::pivotGet('id', $ids);
}
static function fillGroups(&$notices)
$gids = array_unique($gids);
- $group = Memcached_DataObject::pivotGet('User_group', 'id', $gids);
+ $group = User_group::pivotGet('id', $gids);
foreach ($notices as $notice)
{
$fileIds = array_unique($fileIds);
- $fileMap = Memcached_DataObject::pivotGet('File', 'id', $fileIds);
+ $fileMap = File::pivotGet('id', $fileIds);
foreach ($notices as $notice)
{
{
return $this;
}
-
- static function pivotGet($key, $values, $otherCols=array()) {
- return Memcached_DataObject::pivotGet('Profile', $key, $values, $otherCols);
- }
}
$ids = $this->getNoticeIds($offset, $limit, $sinceId, $maxId);
- $notices = Memcached_DataObject::pivotGet('Notice', 'id', $ids);
+ $notices = Notice::pivotGet('id', $ids);
// By default, takes out false values
$ids[] = $notice->id;
}
- Memcached_DataObject::pivotGet('Fave', 'notice_id', $ids, array('user_id' => $p->id));
- Memcached_DataObject::pivotGet('Notice', 'repeat_of', $ids, array('profile_id' => $p->id));
+ Fave::pivotGet('notice_id', $ids, array('user_id' => $p->id));
+ Notice::pivotGet('repeat_of', $ids, array('profile_id' => $p->id));
}
Event::handle('EndNoticeListPrefill', array(&$notices, &$profiles, $avatarSize));
$pids[] = $profile->id;
}
- Memcached_DataObject::pivotGet('Profile_role',
- 'profile_id',
- $pids,
- array('role' => Profile_role::SILENCED));
+ Profile_role::pivotGet('profile_id',
+ $pids,
+ array('role' => Profile_role::SILENCED));
}
}
}