destructr/examples/example_factory.php

31 lines
748 B
PHP
Raw Normal View History

2020-08-26 17:53:27 +00:00
<?php
use Destructr\Factory;
class ExampleFactory extends Factory {
/**
* Example factory with a different schema, to index on random_data, but not
* by dso_type.
*
* Also uses a different column name for dso.id
2020-08-26 17:53:27 +00:00
*/
protected $schema = [
2020-08-26 17:53:27 +00:00
'dso.id' => [
'name'=>'dso_id_other_name',
2020-08-26 17:53:27 +00:00
'type'=>'VARCHAR(16)',
'index' => 'BTREE',
'unique' => true,
'primary' => true
],
'dso.deleted' => [
'name'=>'dso_deleted',
'type'=>'INT',
2020-08-26 17:53:27 +00:00
'index'=>'BTREE'
],
'random_data' => [
'name'=>'random_data',
2020-08-26 17:53:27 +00:00
'type'=>'VARCHAR(100)',
'index'=>'BTREE'
]
];
}