You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
im have model - Model_Category
and relation $_many_many = array('posts')
how can i get lists categoryes and get count relation
like:
category (100posts)
category2 (300posts)
category3 (600posts)
$cats= Model_Category::query()->get();
foreach($cats as $cat){
echo $cat->name . ' ' . count($cat->posts);
}
-> this method not good
im need only count - and not full posts lists
because there are a lot of posts
The text was updated successfully, but these errors were encountered:
im have model - Model_Category
and relation $_many_many = array('posts')
how can i get lists categoryes and get count relation
like:
category (100posts)
category2 (300posts)
category3 (600posts)
$cats= Model_Category::query()->get();
foreach($cats as $cat){
echo $cat->name . ' ' . count($cat->posts);
}
-> this method not good
im need only count - and not full posts lists
because there are a lot of posts
The text was updated successfully, but these errors were encountered: