Re: The new Hash class and complex find statements.
So it isn't possible? -- Dott. Stefano Zoffoli *Web Development & Internet Technologies * *Librasoft Snc *http://www.librasoftsnc.it Via della Luna, 13 47034 Forlimpopoli (FC) Tel. +39 0543 424612 Fax +39 0543 424612 2012/7/6 ankit patel > Stefano Zoffoli I think you are right > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > at http://groups.google.com/group/cake-php > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: The new Hash class and complex find statements.
Stefano Zoffoli I think you are right -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: The new Hash class and complex find statements.
Nope, This gives me only "Content" values, i also want the associated "User" array. ( in my example i inverted the arguments of Hash::extract(), but that is not the problem ) -- Dott. Stefano Zoffoli *Web Development & Internet Technologies * *Librasoft Snc *http://www.librasoftsnc.it Via della Luna, 13 47034 Forlimpopoli (FC) Tel. +39 0543 424612 Fax +39 0543 424612 2012/7/6 Steve Found > Hash::extract('{n}.Content[type=/Article/]', $items); > > I think :) > > > > On 06/07/12 10:19, Stefano Zoffoli wrote: > > Hi, > > i'll start with an example. This is my array: > > $items = array( > 0 => array( > 'Content' => array( > 'id' => '1', > ... > 'type' => 'Article', > ... > ), > 'User' => array( > ... > ), > ), > 1 => array( > 'Content' => array( > 'id' => '2', > ... > 'type' => 'Page', > ... > ), > 'User' => array( > ... > ), > ), > 2 => array( > 'Content' => array( > 'id' => '3', > ... > 'type' => 'Article', > ... > ), > 'User' => array( > ... > ), > ), > ); > > With the old Set class i could use xpath syntax to filter by content > type like this: > > $results = Set::extract('/Content[type=Article]/..', $children); > > And it gave me this array: > > $results = array( > 0 => array( > 'Content' => array( > 'id' => '1', > ... > 'type' => 'Article', > ... > ), > 'User' => array( > ... > ), > ), > 1 => array( > 'Content' => array( > 'id' => '3', > ... > 'type' => 'Article', > ... > ), > 'User' => array( > ... > ), > ), > ); > > I tried to convert that function call with the new Hash class, but i > failed. > I tried: > > Hash::extract('{n}.Content[type=Article]', $items); > Hash::extract('{n}.Content[type=Article]..', $items); > Hash::extract('{n}[Content.type=Article]', $items); > Hash::extract('{n}[type=Article]', $items); > Hash::extract('{n}.[Content.type=Article]', $items); > Hash::extract('{n}.[type=Article]', $items); > > and the same with quoted condition ([type="Article"]). > > How can I do to have the same results as before? > > -- > Dott. Stefano Zoffoli > *Web Development & Internet Technologies > * > *Librasoft Snc > *http://www.librasoftsnc.it > Via della Luna, 13 > 47034 Forlimpopoli (FC) > Tel. +39 0543 424612 > Fax +39 0543 424612 > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > at http://groups.google.com/group/cake-php > > > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > cake-php+unsubscr...@googlegroups.com For more options, visit this group > at http://groups.google.com/group/cake-php > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: The new Hash class and complex find statements.
Hash::extract('{n}.Content[type=/Article/]', $items); I think :) On 06/07/12 10:19, Stefano Zoffoli wrote: Hi, i'll start with an example. This is my array: $items = array( 0=> array( 'Content' => array( 'id' => '1', ... 'type' => 'Article', ... ), 'User' => array( ... ), ), 1=> array( 'Content' => array( 'id' => '2', ... 'type' => 'Page', ... ), 'User' => array( ... ), ), 2=> array( 'Content' => array( 'id' => '3', ... 'type' => 'Article', ... ), 'User' => array( ... ), ), ); With the old Set class i could use xpath syntax to filter by content type like this: $results = Set::extract('/Content[type=Article]/..', $children); And it gave me this array: $results = array( 0=> array( 'Content' => array( 'id' => '1', ... 'type' => 'Article', ... ), 'User' => array( ... ), ), 1=> array( 'Content' => array( 'id' => '3', ... 'type' => 'Article', ... ), 'User' => array( ... ), ), ); I tried to convert that function call with the new Hash class, but i failed. I tried: Hash::extract('{n}.Content[type=Article]', $items); Hash::extract('{n}.Content[type=Article]..', $items); Hash::extract('{n}[Content.type=Article]', $items); Hash::extract('{n}[type=Article]', $items); Hash::extract('{n}.[Content.type=Article]', $items); Hash::extract('{n}.[type=Article]', $items); and the same with quoted condition ([type="Article"]). How can I do to have the same results as before? -- Dott. Stefano Zoffoli /Web Development & Internet Technologies / *Librasoft Snc *http://www.librasoftsnc.it Via della Luna, 13 47034 Forlimpopoli (FC) Tel. +39 0543 424612 Fax +39 0543 424612 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
The new Hash class and complex find statements.
Hi, i'll start with an example. This is my array: $items = array( 0 => array( 'Content' => array( 'id' => '1', ... 'type' => 'Article', ... ), 'User' => array( ... ), ), 1 => array( 'Content' => array( 'id' => '2', ... 'type' => 'Page', ... ), 'User' => array( ... ), ), 2 => array( 'Content' => array( 'id' => '3', ... 'type' => 'Article', ... ), 'User' => array( ... ), ), ); With the old Set class i could use xpath syntax to filter by content type like this: $results = Set::extract('/Content[type=Article]/..', $children); And it gave me this array: $results = array( 0 => array( 'Content' => array( 'id' => '1', ... 'type' => 'Article', ... ), 'User' => array( ... ), ), 1 => array( 'Content' => array( 'id' => '3', ... 'type' => 'Article', ... ), 'User' => array( ... ), ), ); I tried to convert that function call with the new Hash class, but i failed. I tried: Hash::extract('{n}.Content[type=Article]', $items); Hash::extract('{n}.Content[type=Article]..', $items); Hash::extract('{n}[Content.type=Article]', $items); Hash::extract('{n}[type=Article]', $items); Hash::extract('{n}.[Content.type=Article]', $items); Hash::extract('{n}.[type=Article]', $items); and the same with quoted condition ([type="Article"]). How can I do to have the same results as before? -- Dott. Stefano Zoffoli *Web Development & Internet Technologies * *Librasoft Snc *http://www.librasoftsnc.it Via della Luna, 13 47034 Forlimpopoli (FC) Tel. +39 0543 424612 Fax +39 0543 424612 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php