1 | <?php |
||
19 | trait FileFixtureTrait |
||
20 | { |
||
21 | /** |
||
22 | * @var string the directory path or [path alias](guide:concept-aliases) that contains the fixture data |
||
23 | */ |
||
24 | public $dataDirectory; |
||
25 | /** |
||
26 | * @var string|bool the file path or [path alias](guide:concept-aliases) of the data file that contains the fixture data |
||
27 | * to be returned by [[getData()]]. You can set this property to be false to prevent loading any data. |
||
28 | */ |
||
29 | public $dataFile; |
||
30 | |||
31 | /** |
||
32 | * Returns the fixture data. |
||
33 | * |
||
34 | * The default implementation will try to return the fixture data by including the external file specified by [[dataFile]]. |
||
35 | * The file should return the data array that will be stored in [[data]] after inserting into the database. |
||
36 | * |
||
37 | * @param string $file the data file path |
||
38 | * @return array the data to be put into the database |
||
39 | * @throws InvalidConfigException if the specified data file does not exist. |
||
40 | */ |
||
41 | 19 | protected function loadData($file) |
|
58 | |||
59 | } |
||
60 |