<?php
namespace Customize\Repository;
use Eccube\Entity\Category;
use Doctrine\Persistence\ManagerRegistry as RegistryInterface;
use Eccube\Repository\AbstractRepository; #Repositoryを拡張する為
use Doctrine\Common\Collections\ArrayCollection;
use Eccube\Common\EccubeConfig;
use Eccube\Doctrine\Query\Queries;
use Eccube\Util\StringUtil;
/**
* CustomizeProductRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class CategoryRepository extends AbstractRepository
{
/**
* CategoryRepository constructor.
*
* @param RegistryInterface $registry
*/
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, Category::class);
}
/**
* 全検索
*
* @return Categories|array
*/
public function customFindAll() #関数名(何でも良い)
{
$qb = $this->createQueryBuilder("category");
$Categories = $qb
->getQuery() #作成したクエリを取得
->getResult(); #実行
return $Categories;
}
}