-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
57 lines (56 loc) · 1.94 KB
/
example.php
File metadata and controls
57 lines (56 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
return array(
'user' => array(
'count' => 2,
'fields' => array(
'id' => 'ai',
'name' => array(
'type' => 'source',
'source' => array('Mary', 'Chuck', 'Bob', 'Den'),
),
'age' => 'rand:20,30',
'group' => 'source::groups',
'post' => array(
'type' => 'relation',
'count' => '1,2',
'offset' => 3,
'fields' => array(
'id' => 'ai',
'user_id' => 'foreign',
'title' => array(
'type' => 'expr',
'value' => function($number)
{
return "Post # $number";
},
),
'text' => 'scalar:message text',
'tag' => array(
'type' => 'expr',
'value' => '$value',
'source' => 'tags',
),
'comment' => array(
'type' => 'relation',
'count' => 2,
'fields' => array(
'id' => 'ai',
'post_id' => 'foreign',
'author_id' => 'rand:1,5',
'text' => 'scalar:comment text',
'date' => array(
'type' => 'scalar',
'value' => 'NOW()',
'escape' => false
),
'rating' => array(
'type' => 'rand',
'source' => array(-2,-1,0,1,2,3,4),
),
)
)
)
)
)
)
);