Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.6.12
- This topic has 4 replies, 2 voices, and was last updated 8 years, 9 months ago by
Kenneth Ho.
-
AuthorPosts
-
11/08/2017 at 11:58 am #440544
Kenneth Ho
ParticipantHi Steve,
In the function, public function getPhoneNumbers( $atts = array(), $cached = TRUE, $saving = FALSE ), why are phone numbers being cached? Does that mean the cache and db will never be out of sync?
11/08/2017 at 1:26 pm #440550Steven Zahm
Keymaster@ Kenneth
I do not recommend changing the defaults of cached and saving when using the function. They’re for internal use.
The cache is the data stored in the main table which represents the data in the dependent table. For example. The entry’s phone numbers are saved in the phone number table and as a serialized representation of the phone number table data in the primary entry table in the phone column. This allows the phone data to be displayed without having to do extra data queries. The is much more performant. The only time the actual phone number table data is used is when you edit the entry and when searches are done. Performing a search on a table is far faster that trying to search serialized strings.
Hoe that helps!
11/08/2017 at 5:41 pm #440557Kenneth Ho
ParticipantThanks, Steve. What I want to do is get the phone numbers after an update action on an entry. I tried the following:
do_action( 'cn_updated-entry',$this); function update_info( $this ) { $data = array(); $entry = new cnEntry($this); $IdIn = $entry->getId(); $data['phone_numbers'] = array( 'raw' => $entry->getPhoneNumbers( 'raw'), 'rendered' => $entry->getPhoneNumbers(), ); } add_action('cn_updated_entry', 'update_info');Whenever I examine $data[‘phone_numbers’] the array with the keys ‘raw’ and ‘rendered” seem to show empty values for both keys. Can you tell me what’s wrong?
-
This reply was modified 8 years, 9 months ago by
Steven Zahm. Reason: Cleanup up code formatting to make it easier to read
11/09/2017 at 10:05 am #440622Steven Zahm
Keymaster@ Kenneth
I do not really understand what you are trying to do… but here’s the correct code which will get the results you expect:
function update_info( $entry ) { $data = array(); $IdIn = $entry->getId(); $html = new cnOutput(); $html->set( $IdIn ); $data['phone_numbers'] = array( 'raw' => $entry->getPhoneNumbers(), 'rendered' => $html->getPhoneNumberBlock( array( 'return' => true ) ), ); var_dump( $data ); die(); } add_action( 'cn_updated-entry', 'update_info' );Hope that helps!
11/09/2017 at 10:14 am #440624Kenneth Ho
ParticipantThanks Steven. I’ll try it out, I just wanted to store an entry into another database after it gets updated on WordPress.
-
This reply was modified 8 years, 9 months ago by
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
