Hello,
I wrote this function to count and compare two different entities:
$count_myent1s = count_user_objects($user->guid, "myent1", false);
$myent1s = get_user_objects($user->guid, "myent1", false, 99);
if (!empty($vars['entity']->name)) {
$i = 1;
foreach ($myent1s as $ent) {
if (($ent->name) === ($vars['entity']->name)) {
echo $i;
$i++; }
}
}
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.
- Team Webgalli@webgalli

Team Webgalli - 0 likes
- Tomaw@tomaw

Tomaw - 0 likes
- Kevin Jardine@kevin

Kevin Jardine - 0 likes
- Team Webgalli@webgalli

Team Webgalli - 0 likes
You must log in to post replies.If the delete function is properly coded, it will remove that content entirely. What exactly you mean by "counts the entities that have been deleted!?" Make sure your code for deletion is a proper one.
Hello Team Webgalli,
When I say "counts the Entities That Have Been deleted!?" Is in fact my function that compares continues to show the same results when I removed an object instance. I'll go see if they are still contained in my database, and then I would see to remove cleanly.
Tomaw,
remember that the only way to delete an Elgg entity is:
$entity->delete();
In Elgg an entity has components scattered across multiple tables and the database should never be accessed directly.
Kevin is right. Elgg entity data and its comments, relations all are in different tabls. Whatever action you are doing on elgg, do it through elgg functions.