Skip to content

Instantly share code, notes, and snippets.

@siran
Last active May 13, 2017 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save siran/be048d5b02c82461d22b08dce8feea91 to your computer and use it in GitHub Desktop.
Save siran/be048d5b02c82461d22b08dce8feea91 to your computer and use it in GitHub Desktop.
working with collections
<?php
$list = $this->Transacciones->find()
->distinct(...)
->select(...)
->contain(...)
->order(...)
->reject(...)
->sortBy(...);
//debug($list);
//LIST IS OK!
$sublist = array_values($lista_orden_id->extract('entidad_id')->toArray());
//debug($sublist);
//LIST IS **NOT** OK: I get values that were already rejected in $list
//question: How can I obtain a $sublist by manipulating $list without resetting the values to the original query?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment