- Timestamp:
- 01/03/2016 06:14:41 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/classes/class-bp-xprofile-profiledata.php
r10417 r10434 11 11 defined( 'ABSPATH' ) || exit; 12 12 13 /** 14 * Class for XProfile Profile Data setup. 15 * 16 * @since 1.6.0 17 */ 13 18 class BP_XProfile_ProfileData { 19 20 /** 21 * XProfile ID. 22 * 23 * @var int $id 24 */ 14 25 public $id; 26 27 /** 28 * User ID. 29 * 30 * @var int $user_id 31 */ 15 32 public $user_id; 33 34 /** 35 * XProfile field ID. 36 * 37 * @var int $field_id 38 */ 16 39 public $field_id; 40 41 /** 42 * XProfile field value. 43 * 44 * @var string $value 45 */ 17 46 public $value; 47 48 /** 49 * XProfile field last updated time. 50 * 51 * @var string $last_updated 52 */ 18 53 public $last_updated; 19 54 55 /** 56 * BP_XProfile_ProfileData constructor. 57 * 58 * @param null $field_id Field ID to instantiate. 59 * @param null $user_id User ID to instantiate for. 60 */ 20 61 public function __construct( $field_id = null, $user_id = null ) { 21 62 if ( !empty( $field_id ) ) { … … 24 65 } 25 66 67 /** 68 * Populates the XProfile profile data. 69 * 70 * @param int $field_id Field ID to populate. 71 * @param int $user_id User ID to populate for. 72 */ 26 73 public function populate( $field_id, $user_id ) { 27 74 global $wpdb; … … 111 158 } 112 159 160 /** 161 * Save the data for the XProfile field. 162 * 163 * @return bool 164 */ 113 165 public function save() { 114 166 global $wpdb; … … 208 260 * @param int $user_id ID of user whose data is being queried. 209 261 * @param array $field_ids Array of field IDs to query for. 210 *211 262 * @return array 212 263 */ … … 274 325 * 275 326 * @param int $user_id ID of the user. 276 *277 327 * @return array 278 328 */ … … 321 371 * @param int $field_id Field ID being queried for. 322 372 * @param int $user_id User ID associated with field. 323 *324 373 * @return int $fielddata_id 325 374 */ … … 352 401 * @param int $field_id ID of the field. 353 402 * @param int|array|null $user_ids ID or IDs of user(s). 354 *355 403 * @return string|array Single value if a single user is queried, 356 404 * otherwise an array of results. … … 428 476 } 429 477 478 /** 479 * Get profile field values by field name and user ID. 480 * 481 * @param array|string $fields Field(s) to get. 482 * @param int|null $user_id User ID to get field data for. 483 * @return array|bool 484 */ 430 485 public static function get_value_byfieldname( $fields, $user_id = null ) { 431 486 global $wpdb; … … 483 538 } 484 539 540 /** 541 * Delete field. 542 * 543 * @param int $field_id ID of the field to delete. 544 * @return bool 545 */ 485 546 public static function delete_for_field( $field_id ) { 486 547 global $wpdb; … … 495 556 } 496 557 558 /** 559 * Get time for last XProfile field data update by user. 560 * 561 * @param int $user_id User ID to get time for. 562 * @return null|string 563 */ 497 564 public static function get_last_updated( $user_id ) { 498 565 global $wpdb; … … 505 572 } 506 573 574 /** 575 * Delete all data for provided user ID. 576 * 577 * @param int $user_id User ID to remove data for. 578 * @return false|int 579 */ 507 580 public static function delete_data_for_user( $user_id ) { 508 581 global $wpdb; … … 513 586 } 514 587 588 /** 589 * Get random field type by user ID. 590 * 591 * @param int $user_id User ID to query for. 592 * @param string $exclude_fullname SQL portion used to exclude by field ID. 593 * @return array|null|object 594 */ 515 595 public static function get_random( $user_id, $exclude_fullname ) { 516 596 global $wpdb; … … 523 603 } 524 604 605 /** 606 * Get fullname for provided user ID. 607 * 608 * @param int $user_id ID of the user to query. 609 * @return mixed 610 */ 525 611 public static function get_fullname( $user_id = 0 ) { 526 612
Note: See TracChangeset
for help on using the changeset viewer.