示例#1
0
 /**
  * @param $networkID
  * @param $sid
  * @return array|null
  */
 public static function getFeedInfoByNetworkIdAndSID($networkID, $sid)
 {
     $feedInfo = SJB_ObjectDBManager::getObjectInfo($networkID . "_feeds", $sid);
     if (!empty($feedInfo)) {
         $feedInfo['id'] = $feedInfo['sid'];
         return $feedInfo;
     }
     return null;
 }
示例#2
0
 public static function getCommentsInfoBySIDCollection($sid_collection)
 {
     $comments = array();
     foreach ($sid_collection as $comment_sid) {
         $comment = parent::getObjectInfo("comments", $comment_sid);
         $comment['id'] = $comment['sid'];
         $comments[] = $comment;
     }
     return $comments;
 }
示例#3
0
 public static function getProductExtraInfoBySID($productSID)
 {
     $product = SJB_ObjectDBManager::getObjectInfo("products", $productSID);
     $serialized_extra_info = array();
     if (!empty($product['serialized_extra_info'])) {
         $serialized_extra_info = unserialize($product['serialized_extra_info']);
     }
     $serialized_extra_info['product_sid'] = $productSID;
     return $serialized_extra_info;
 }
 public static function saveUserProfileField($user_profile_field, $recursive = false)
 {
     $user_group_sid = $user_profile_field->getUserGroupSID();
     if ($user_group_sid) {
         $fieldID = false;
         $sid = $user_profile_field->getSID();
         if ($sid) {
             $fieldInfo = parent::getObjectInfo('user_profile_fields', $sid);
             if (!empty($fieldInfo['id'])) {
                 $fieldID = $fieldInfo['id'];
             }
         }
         parent::saveObject("user_profile_fields", $user_profile_field);
         $userFieldType = $user_profile_field->getPropertyValue('type');
         if ($userFieldType == 'location') {
             if (!$sid) {
                 $userProfileFeld = new SJB_UserProfileField(array('id' => 'Country', 'caption' => 'Country', 'type' => 'list'));
                 $userProfileFeld->setUserGroupSID($user_group_sid);
                 $userProfileFeld->addParentSID($user_profile_field->getSID());
                 self::saveUserProfileField($userProfileFeld, true);
                 $userProfileFeld = new SJB_UserProfileField(array('id' => 'State', 'caption' => 'State', 'type' => 'list'));
                 $userProfileFeld->setUserGroupSID($user_group_sid);
                 $userProfileFeld->addParentSID($user_profile_field->getSID());
                 self::saveUserProfileField($userProfileFeld, true);
                 $userProfileFeld = new SJB_UserProfileField(array('id' => 'City', 'caption' => 'City', 'type' => 'string'));
                 $userProfileFeld->setUserGroupSID($user_group_sid);
                 $userProfileFeld->addParentSID($user_profile_field->getSID());
                 self::saveUserProfileField($userProfileFeld, true);
                 $userProfileFeld = new SJB_UserProfileField(array('id' => 'ZipCode', 'caption' => 'ZipCode', 'type' => 'geo'));
                 $userProfileFeld->setUserGroupSID($user_group_sid);
                 $userProfileFeld->addParentSID($user_profile_field->getSID());
                 self::saveUserProfileField($userProfileFeld, true);
                 $userProfileFeld = new SJB_UserProfileField(array('id' => 'Address', 'caption' => 'Address', 'type' => 'string'));
                 $userProfileFeld->setUserGroupSID($user_group_sid);
                 $userProfileFeld->addParentSID($user_profile_field->getSID());
                 self::saveUserProfileField($userProfileFeld, true);
             }
             parent::saveLocationField("users", "user_profile_fields", $user_profile_field, $fieldID);
         } else {
             if (!$recursive) {
                 parent::saveField("users", "user_profile_fields", $user_profile_field, $fieldID);
             }
         }
         if ($user_profile_field->getOrder()) {
             return true;
         }
         $max_order = SJB_DB::queryValue("SELECT MAX(`order`) FROM user_profile_fields WHERE user_group_sid = ?n", $user_group_sid);
         $next_order = $max_order + 1;
         return SJB_DB::query("UPDATE user_profile_fields SET user_group_sid = ?n, `order` = ?n WHERE sid = ?n", $user_group_sid, $next_order, $user_profile_field->getSID());
     }
     return false;
 }
示例#5
0
 public static function getUserInfoBySID($user_sid)
 {
     return parent::getObjectInfo("users", $user_sid);
 }
示例#6
0
 public static function getCurrencyInfoBySID($currency_sid)
 {
     return parent::getObjectInfo("currency", $currency_sid);
 }
示例#7
0
 public static function getEmailInfoBySID($email_sid)
 {
     return SJB_ObjectDBManager::getObjectInfo("email_log", $email_sid);
 }
示例#8
0
 public static function getObjectInfoBySID($db_table_name, $object_sid)
 {
     return SJB_ObjectDBManager::getObjectInfo($db_table_name, $object_sid);
 }
示例#9
0
 public static function getObjectsInfoByType($db_table_name)
 {
     $objects_info = SJB_DB::query('SELECT * FROM ?w', $db_table_name);
     foreach ($objects_info as $i => $object_info) {
         $objects_info[$i] = SJB_ObjectDBManager::getObjectInfo($db_table_name, $object_info['sid']);
     }
     return $objects_info;
 }
示例#10
0
 public static function getListingInfoBySID($listing_sid)
 {
     return parent::getObjectInfo('listings', $listing_sid);
 }
示例#11
0
 public static function getUserProfileFieldInfoByID($user_field_id)
 {
     $cache = SJB_Cache::getInstance();
     $cacheId = md5('SJB_UserProfileFieldManager::getUserProfileFieldInfoByID' . $user_field_id);
     if ($cache->test($cacheId)) {
         return $cache->load($cacheId);
     }
     $result = null;
     $sid = self::getUserProfileFieldsValue($user_field_id, 'id');
     if (!empty($sid)) {
         $user_field_sid = $sid[0]['sid'];
         $result = SJB_ObjectDBManager::getObjectInfo('user_profile_fields', $user_field_sid);
     }
     $cache->save($result, $cacheId, array(SJB_Cache::TAG_FIELDS));
     return $result;
 }
 public static function getFieldInfoBySID($field_sid)
 {
     $field_info = parent::getObjectInfo("questions", $field_sid);
     self::setComplexFields($field_info);
     return $field_info;
 }
示例#13
0
 public static function getListingTypeInfoBySID($listing_type_sid)
 {
     return parent::getObjectInfo("listing_types", $listing_type_sid);
 }
示例#14
0
 public static function getInfoBySID($sid)
 {
     return SJB_ObjectDBManager::getObjectInfo('screening_questionnaires', $sid);
 }
示例#15
0
 public static function getListingFieldInfoByID($listing_field_id)
 {
     $cache = SJB_Cache::getInstance();
     $cacheId = md5('SJB_ListingFieldDBManager::getListingFieldInfoByID' . $listing_field_id);
     if ($cache->test($cacheId)) {
         return $cache->load($cacheId);
     }
     $result = null;
     $sid = SJB_ListingFieldDBManager::getListingFieldsValue($listing_field_id, 'id');
     if (!empty($sid)) {
         $listing_field_sid = $sid[0]['sid'];
         $result = parent::getObjectInfo('listing_fields', $listing_field_sid);
     }
     $cache->save($result, $cacheId, array(SJB_Cache::TAG_FIELDS));
     return $result;
 }
示例#16
0
 public static function getPaymentLogInfoBySID($payment_sid)
 {
     return SJB_ObjectDBManager::getObjectInfo("payment_log", $payment_sid);
 }
示例#17
0
 public static function getSubAdminInfoBySID($user_sid)
 {
     return parent::getObjectInfo("subadmins", $user_sid);
 }
示例#18
0
 public static function getUserGroupNameBySID($user_group_sid)
 {
     $user_group_info = parent::getObjectInfo("user_groups", $user_group_sid);
     return $user_group_info['name'];
 }
示例#19
0
 public static function getADInfoBySID($ABSid)
 {
     return SJB_ObjectDBManager::getObjectInfo("alphabet", $ABSid);
 }
示例#20
0
 public static function getFieldInfoBySID($sid)
 {
     return SJB_ObjectDBManager::getObjectInfo('polls', $sid);
 }
示例#21
0
 public static function getTaxInfoBySID($sid)
 {
     return SJB_ObjectDBManager::getObjectInfo('taxes', $sid);
 }
示例#22
0
 public static function getCodeInfoBySID($sid)
 {
     $code_info = SJB_ObjectDBManager::getObjectInfo('promotions', $sid);
     return $code_info;
 }