本文整理汇总了PHP中DatabaseObject::getSelectFields方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseObject::getSelectFields方法的具体用法?PHP DatabaseObject::getSelectFields怎么用?PHP DatabaseObject::getSelectFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseObject
的用法示例。
在下文中一共展示了DatabaseObject::getSelectFields方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadObjectForUser
public static function loadObjectForUser(DatabaseObject $object, $user_id, $object_id, $databaseColumn, $options = array())
{
$userId = (int) $user_id;
$productId = (int) $object_id;
if ($options['status'] = 'ALL') {
$statusQuery = '';
} else {
$statusQuery = ' and status="L" ';
}
if ($userId <= 0 || $productId <= 0) {
return;
}
if ($databaseColumn == 'individual_dues_key') {
$userIdColumn = 'clubAdmin_id';
} else {
$userIdColumn = 'user_id';
}
$query = sprintf('select %s from %s where ' . $userIdColumn . ' = %d and %s = %d' . $statusQuery . ' ', join(', ', $object->getSelectFields()), $object->_table, $userId, $databaseColumn, $productId);
echo "<br/>query is: " . $query;
return $object->_load($query);
}