ArrayIterator implements ArrayAccess, which has the offsetUnset() method. You can use this method directly, but you should use unset():
unset($obj["sge"]);
P.S. StackOverflow is a greater resource for answering general programming questions.
object1->data = "alarm,walk,school,home,sleep";
Instead of storing it like that you should store it like this:
object1->data = array(
'alarm',
'walk',
'school',
'home',
'sleep'
);
Then you can properly use the options of elgg_get_entities_from_metadata()
$options = array(
'type' => 'object',
'subtype' => 'subtype',
'metadata_name_value_pairs' => array(
'name' => 'data',
'value' => array('walk', 'alarm')
)
);
Thanks for your help Matt Beckett.
I used this code, but unfortunately its not working.
Instead i used this code for fetching and its working,
$search = array('walk', 'alarm');
$query = array();
foreach ($search as $sec) {
$query[] = array('name' => 'data', 'value' => '%'.$sec.'%', 'operand' => 'LIKE', 'case_sensitive' => false );
};
$object2 = elgg_get_entities_from_metadata(array(
'type'=>'object',
'subtype'=>'object2',
'metadata_name_value_pairs' => $query,
'metadata_name_value_pairs_operator' => 'OR',
));
And i have one more doubt:
Is my code affect the performance of query execution time when both "object2" entities and $search array increases?
That works too - my code wasn't tested, it should work something like that - maybe it's pluralized 'values'
Anyway, yes, performance will decrease the more search fields you add in. If you're building an app that needs to search on a lot of metadata simultaneously I'd recommend offloading search to solr or something. MySQL doesn't do the best job in that regard
The line is at https://github.com/Elgg/Elgg/blob/cd72cd6a0e65ae20fc6ea727cd03d244cbd9e41f/engine/lib/views.php#L1614
elgg_register_js('jquery', '/vendors/jquery/jquery-1.6.4.min.js', 'head');
In your plugin, add a similar line in your init,system handler and point it at a different version. You'll be golden.
Thanks Evan Winslow,
I found this code. Thanks for your help.
You need to register your logo as a topbar menu, example:
elgg_register_menu_item('topbar', array(
'name' => 'custom-logo',
'link_class' => 'custom-logo',
'text' => '<img src="link-to-image" />',
'href' => elgg_get_site_url(),
'priority' => 100,
));
Thanks for your reply cim,
but topbar is only visible when logged in.
You'll need to make a plugin that will override the topbar to show for offline users as well.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.