"Simple questions"
This is an open discussion with 5 replies, filed under General.
Search
Try these:
// fetch the Entry with ID 99 $entry = EntryManager::fetch( 99 ); if( is_array( $entry ) ) $entry = current( $entry ); /** @var $entry Entry */ if( !$entry instanceof Entry ){ // entry with ID 99 doesn't exist } // get an array of data for all fields, by field ID // @see Entry::getData() $data = $entry->getData(); // get data for field with handle = 'name' $section_id = SectionManager::fetchIDFromHandle( 'books' ); $f_name_id = FieldManager::fetchFieldIDFromElementName( 'name', $section_id ); $name = $entry->getData( $f_name_id ); // delete the Entry with ID 99 EntryManager::delete( 99 );
Is there a way to get the XML of an entry after fetching it? I've done it before using the datasource manager but I'm looking for something more direct.
@touchstone, this Gist I made after fumbling around with a custom event might be of some use:
Thanks for the answer guys.... Im having a look into the documentation!!!
Create an account or sign in to comment.
"Simple Questions" that i struggle every day whenever i need to do custom events and load and save data with Symphony
How????
How can i?
Load the entry ?
Like:
Am i gonna have an array with all data from this section?
for example:
Now, if i have to save a section in case:
will save?
And of course the delete?
Simple questions that i couldnt find anywhere yet?
Will wait the gurus around :)
Cheers.