Skip to content

Instantly share code, notes, and snippets.

@maetl
Created May 19, 2010 10:10
Show Gist options
  • Save maetl/406164 to your computer and use it in GitHub Desktop.
Save maetl/406164 to your computer and use it in GitHub Desktop.
<?php
$finder = new Finder("translations");
// OR
class TranslationsFinder extends Finder {}
$finder = new TranslationsFinder();
// BASE METHODS
$record = $finder->findById($id);
$record = $finder->findByKey($key);
$record = $finder->findByNameAndCode($name, $iso);
$collection = $finder->findAll();
$collection = $finder->findAllByNameAndCode($name, $iso);
$query = Query::init();
$query->whereEquals("name", $name)->orderBy("published")->desc();
$collection = $finder->findBy($query);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment