Last active
September 28, 2015 03:48
-
-
Save chanmix51/1380200 to your computer and use it in GitHub Desktop.
Retrieving model class instances
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 | |
//... | |
$transformers = $database | |
->getConnection() | |
->getMapFor('YourDb\Online\PowerSupplyTransformer') | |
->findWhere('stock > $* and voltage = $*', array(5, 220)); | |
foreach($transformers as $transformer) | |
{ | |
printf("%s %s volt (%d in stock)\n", | |
$transformer->reference, | |
$transformer->voltage, | |
$transformer->stock | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment