Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $type1 = $type2 = $type3 = NULL;
- while($entity = array_shift($collection)) {
- if ($type1 && $type2 && $type3) {
- break;
- }
- if (!$type1 && $entity->type = 1) {
- $type1 = $entity;
- }
- else if (!$type2 && $entity->type = 2) {
- $type2 = $entity;
- } else if (!$type3 && $entity->type = 3) {
- $type3 = $entity;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement