Created
October 3, 2010 01:29
-
-
Save joshtronic/608170 to your computer and use it in GitHub Desktop.
PICKLES Proposed "Find All" Syntax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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