Skip to content

make:repository

Generates a repository class that extends one of the three repository abstractions.

Signature

bash
php nikogin make:repository {ClassName} --type={db|wp|taxonomy}

Types

--typeExtendsOutput path
dbRepositoryapp/Repository/Db/
wpWpRepositoryapp/Repository/Wp/
taxonomyTaxonomyRepositoryapp/Repository/Taxonomy/

Examples

bash
# Custom DB table repository
php nikogin make:repository OrderRepository --type=db

# WordPress post-type repository
php nikogin make:repository ProductRepository --type=wp

# WordPress taxonomy repository
php nikogin make:repository TagRepository --type=taxonomy

Generated output (db)

php
namespace Nikogin\Repository\Db;

use Nikogin\Framework\Abstracts\Repository;

class OrderRepository extends Repository
{
    public function __construct()
    {
        parent::__construct('order'); // auto-derived from class name
    }
}

TIP

The constructor argument is auto-derived by stripping the Repository suffix and converting to snake_case. Update it to match your actual table name (including the tc_ prefix if using Migration).

Nikogin Framework — WordPress plugin development made simple.