CakePHP Cookbook Documentation 5.xTurn off assert() code generation. zend.assertions = -1 Skipping code generation for assert() will yield faster runtime performance, and is recommended for applications that have good test coverage or that test method will be run inside a transaction that is rolled back at the end of the test. This can yield improved performance but requires your tests not heavily rely on static fixture data, as auto- increment once over all elements you can use the unfold() method. It will create a new collection that will yield every single element nested in the collection: $items = [[1, 2, 3], [4, 5]]; $collection = new Collection($items);0 码力 | 1080 页 | 939.39 KB | 1 年前3
CakePHP Cookbook Documentation 5.xTurn off assert() code generation. zend.assertions = -1 Skipping code generation for assert() will yield faster runtime performance, and is recommended for applications that have good test coverage or that test method will be run inside a transaction that is rolled back at the end of the test. This can yield improved performance but requires your tests not heavily rely on static fixture data, as auto-increment once over all elements you can use the unfold() method. It will create a new collection that will yield every single element nested in the collection: $items = [[1, 2, 3], [4, 5]]; $collection = new Collection($items);0 码力 | 848 页 | 2.53 MB | 1 年前3
CakePHP Cookbook 4.x
test method will be run inside a transaction that is rolled back at the end of the test. This can yield improved performance but requires your tests not heavily rely on static fixture data, as auto- increment once over all elements you can use the unfold() method. It will create a new collection that will yield every single element nested in the collection: $items = [[1, 2, 3], [4, 5]]; $collection = new Collection($items); ->toList(); }); $allPagesItems = $items->toList(); If you are using PHP 5.5+, you can use the yield keyword inside unfold() to return as many elements for each item in the collection as you may need:0 码力 | 1249 页 | 1.04 MB | 1 年前3
CakePHP Cookbook 4.x
test method will be run inside a transaction that is rolled back at the end of the test. This can yield improved performance but requires your tests not heavily rely on static fixture data, as auto-increment once over all elements you can use the unfold() method. It will create a new collection that will yield every single element nested in the collection: $items = [[1, 2, 3], [4, 5]]; $collection = new Collection($items); Iterating 835 CakePHP Cookbook Documentation, Release 4.x If you are using PHP 5.5+, you can use the yield keyword inside unfold() to return as many elements for each item in the collection as you may need:0 码力 | 967 页 | 2.88 MB | 1 年前3
CakePHP Cookbook 3.x
once over all elements you can use the unfold() method. It will create a new collection that will yield every single element nested in the collection: $items = [[1, 2, 3], [4, 5]]; $collection = new Collection($items); ->toList(); }); $allPagesItems = $items->toList(); If you are using PHP 5.5+, you can use the yield keyword inside unfold() to return as many elements for each item in the collection as you may need: $collection = new Collection($oddNumbers); $new = $collection->unfold(function ($oddNumber) { yield $oddNumber; yield $oddNumber + 1; }); // $result contains [1, 2, 3, 4, 5, 6, 7, 8]; $result = $new->toList();0 码力 | 1244 页 | 1.05 MB | 1 年前3
CakePHP Cookbook 3.x
once over all elements you can use the unfold() method. It will create a new collection that will yield every single element nested in the collection: $items = [[1, 2, 3], [4, 5]]; $collection = new Collection($items); )->toList(); }); $allPagesItems = $items->toList(); If you are using PHP 5.5+, you can use the yield keyword inside unfold() to return as many elements for each item in the collection as you may need: $collection = new Collection($oddNumbers); $new = $collection->unfold(function ($oddNumber) { yield $oddNumber; yield $oddNumber + 1; }); // $result contains [1, 2, 3, 4, 5, 6, 7, 8]; $result = $new->toList();0 码力 | 967 页 | 2.80 MB | 1 年前3
共 6 条
- 1













