[buddypress-trac] [BuddyPress Trac] #6638: XProfile fields should have cache support

buddypress-trac noreply at wordpress.org
Fri Oct 2 21:57:23 UTC 2015


#6638: XProfile fields should have cache support
--------------------------+------------------
 Reporter:  boonebgorges  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  2.4
Component:  API           |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------

Comment (by boonebgorges):

 In [changeset:"10164"]:
 {{{
 #!CommitTicketReference repository="" revision="10164"
 Lazy-load visibility properties in `BP_XProfile_Field`.

 Previously, populating a new `BP_XProfile_Field` object would result in
 two
 queries: one to fetch the field row from the database, and one to populate
 the
 field meta cache in order to set the 'allow_custom_visibility' and
 'default_visibility' properties. It's not often the case that we need the
 latter properties, which means that the cache-priming query is wasted.

 This changeset addresses the shortcoming by loading the properties only
 when
 they're requested:

 * `$allow_custom_visibility` and `$default_visibility` are now protected
 properties of the object. This directs requests for them to the magic
 methods.
 * Introduce `__isset()` and `__get()` to handle backward compatibility.
 * Introduce public getter functions for each property.

 See #6638.
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6638#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list