@@ -15,8 +15,8 @@ event or setting information, and more.
15
15
Database Seeders
16
16
****************
17
17
18
- Database seeders are simple classes that must have a ** run() ** method, and extend ``CodeIgniter\Database\Seeder ``.
19
- Within the ** run() ** the class can create any form of data that it needs to. It has access to the database
18
+ Database seeders are simple classes that must have a `` run() `` method, and extend ``CodeIgniter\Database\Seeder ``.
19
+ Within the `` run() `` the class can create any form of data that it needs to. It has access to the database
20
20
connection and the forge through ``$this->db `` and ``$this->forge ``, respectively. Seed files must be
21
21
stored within the **app/Database/Seeds ** directory. The name of the file must match the name of the class.
22
22
@@ -26,12 +26,12 @@ stored within the **app/Database/Seeds** directory. The name of the file must ma
26
26
Nesting Seeders
27
27
***************
28
28
29
- Seeders can call other seeders, with the ** call() ** method. This allows you to easily organize a central seeder,
29
+ Seeders can call other seeders, with the `` call() `` method. This allows you to easily organize a central seeder,
30
30
but organize the tasks into separate seeder files:
31
31
32
32
.. literalinclude :: seeds/002.php
33
33
34
- You can also use a fully-qualified class name in the ** call() ** method, allowing you to keep your seeders
34
+ You can also use a fully-qualified class name in the `` call() `` method, allowing you to keep your seeders
35
35
anywhere the autoloader can find them. This is great for more modular code bases:
36
36
37
37
.. literalinclude :: seeds/003.php
@@ -63,10 +63,10 @@ Using the command line, you can easily generate seed files.
63
63
> php spark make:seeder user --suffix
64
64
// Output: UserSeeder.php file located at app/Database/Seeds directory.
65
65
66
- You can supply the ** root ** namespace where the seed file will be stored by supplying the ``--namespace `` option::
66
+ You can supply the `` root `` namespace where the seed file will be stored by supplying the ``--namespace `` option::
67
67
68
68
> php spark make:seeder MySeeder --namespace Acme\\Blog
69
69
70
- If ``Acme\Blog `` is mapped to `` app/Blog `` directory, then this command will generate `` MySeeder.php `` at `` app/Blog/Database/Seeds `` directory.
70
+ If ``Acme\Blog `` is mapped to ** app/Blog ** directory, then this command will generate ** MySeeder.php ** at ** app/Blog/Database/Seeds ** directory.
71
71
72
72
Supplying the ``--force `` option will overwrite existing files in destination.
0 commit comments