Skip to content

Instantly share code, notes, and snippets.

@joshtronic
Created October 3, 2010 01:29
Show Gist options
  • Save joshtronic/608170 to your computer and use it in GitHub Desktop.
Save joshtronic/608170 to your computer and use it in GitHub Desktop.
PICKLES Proposed "Find All" Syntax
<?php
// Empty model
$model = new Model();
// Pull by ID
$model = new Model(123);
// Pull by condition(s)
$model = new Model(array('conditions' => array('id' => 123)));
// Pull all
$model = new Model(true); // Current approach -- feels too cryptic though
$model = new Model('all'); // Proposed #1 -- REALLY LEANING TOWARDS THIS ONE
$model = new Model(MODEL_ALL); // Proposed #2 - constant can be anything really
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment