Seeder
class Seeder
Class Seeder
TODO: Use a future DB class Currently we're using the WordPress wpdb object. In the future, would be nice to use a custom DB class.
Properties
protected string | $tablename | The database table name. | |
protected | $wpdb | The WordPress database object. | |
protected bool | $runOnce | This flag is used to run the seeder only once. |
Methods
__construct()
Run the database seeds.
run()
Run the database seeds.
query(string $sql)
Execute any SQL statement.
int
count()
Retrun the number of rows in the table.
insert(string $sql)
Insert a row into a table.
truncate($tablename = "")
Truncate a table.
Details
at line 39
__construct()
Run the database seeds.
at line 55
abstract
run()
Run the database seeds.
You have to override this method in your seeder class.
at line 62
protected
query(string $sql)
Execute any SQL statement.
at line 72
protected int
count()
Retrun the number of rows in the table.
at line 82
protected
insert(string $sql)
Insert a row into a table.
at line 92
protected
truncate($tablename = "")
Truncate a table.