posts input now separate key, more room for other things
This commit is contained in:
parent
df5c47e2d3
commit
b41a580502
@ -113,12 +113,20 @@ class PostFixtures {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function process_data($data) {
|
function process_data($data) {
|
||||||
$posts = $data;
|
$posts = array();
|
||||||
$categories = array();
|
$categories = array();
|
||||||
foreach ($data as $post) {
|
|
||||||
$post = (array)$post;
|
foreach ($data as $type => $info) {
|
||||||
if (isset($post['categories'])) {
|
switch ($type) {
|
||||||
$categories = array_merge($categories, $post['categories']);
|
case 'posts':
|
||||||
|
$posts = $info;
|
||||||
|
foreach ($posts as $post) {
|
||||||
|
$post = (array)$post;
|
||||||
|
if (isset($post['categories'])) {
|
||||||
|
$categories = array_merge($categories, $post['categories']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$categories = array_unique($categories);
|
$categories = array_unique($categories);
|
||||||
|
Loading…
Reference in New Issue
Block a user