This post originated from an RSS feed registered with PHP Buzz
by Forum One.
Original Post: Ease of Development Example
Feed Title: Syntax Framework
Feed URL: http://blog.syntaxcms.org/rss.php?version=0.91
Feed Description: Finally, a place to answer Syntax questions
Here is a quick example of how the Syntax API accelerates development by making it easy to search for a collection of objects. In this case, I had an array with some country info, including the name. I needed to see if any documents were tagged to that country:
Step one, figure out the numeric id of the country:
Step two, use a Document Collection to find matching records:
$documents = new DocumentCollection();
$documents->findByCountries( $pick_id );
$documents->execute();
If you use dbasis to generate the code for your abstract collection object, it will create methods for filtering/finding by any relationship or pick field in your object.