Jump to content

Using a selector, how do I find a page created by a specific user?


desbest
 Share

Recommended Posts

What is the difference between $pages->find() and $pages->get() ? They both look the same to me. Is ->get() for finding an individual page whereas find->() is for more than one?

Also how do I find a page using a selector based on which user created the page? I couldn't find anything under Selectors documentation on how to do it.

Link to comment
Share on other sites

Find gives you multiple pages (actually a PageArray with zero or more pages) , and respects page status, whether it's hidden and access settings, while get gives you the page (a Page/NullPage object) disregarding access preferences. 

To find pages created by a particular user, you need

$myUser = $users->get('admin');
$myPages = $pages->find("created_users_id=$myUser");

 

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...