Created
February 8, 2011 20:12
-
-
Save nnarhinen/817123 to your computer and use it in GitHub Desktop.
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 | |
class MyPropelObjectCollection extends PropelObjectCollection | |
{ | |
public function each(Closure $callback) | |
{ | |
foreach ($this as $obj) { | |
if ($callback($obj) === false) { | |
break; | |
} | |
} | |
} | |
} |
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 | |
class MyPropelObjectFormatter extends PropelObjectFormatter | |
{ | |
protected $collectionName = 'MyPropelObjectCollection'; | |
} |
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 | |
MyFooQuery::create() | |
->filterBySomething('Something') | |
->setFormatter('MyPropelObjectFormatter') | |
->find() | |
->each(function($obj) { //do something }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment