PHP code example of barbarossa42 / nextras-orm-command
1. Go to this page and download the library: Download barbarossa42/nextras-orm-command library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
barbarossa42 / nextras-orm-command example snippets
namespace App\Orm\Articles\Article;
use Nextras\Orm\Entity\Entity;
/**
* Article Entity class
* @property int $id {primary}
*/
class Article extends Entity
{
}
namespace App\Orm\Articles\Article;
use Nextras\Orm\Repository\Repository;
class ArticleRepository extends Repository
{
public static function getEntityClassNames(): array
{
return [Article::class];
}
}
namespace App\Orm\Articles\Article;
use Nextras\Orm\Mapper\Mapper;
class ArticleMapper extends Mapper
{
protected $tableName = 'articles';
}
const NS_ENTITY = 'App\Core\Entity';