{"id":12850,"date":"2024-07-14T07:00:30","date_gmt":"2024-07-13T22:00:30","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=12850"},"modified":"2024-06-28T17:46:30","modified_gmt":"2024-06-28T08:46:30","slug":"%e3%80%90ec-cube-4%e3%80%91%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%a7%e6%97%a2%e5%ad%98%e3%83%86%e3%83%bc%e3%83%96%e3%83%ab%e6%8b%a1%e5%bc%b510%e3%82%b9%e3%83%86%e3%83%83%e3%83%97","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=12850","title":{"rendered":"\u3010EC-CUBE\u30d7\u30e9\u30b0\u30a4\u30f3\u3011\u65e2\u5b58\u3068\u72ec\u81ea\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408\u3059\u308b5\u30b9\u30c6\u30c3\u30d7"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001<code>EC-CUBE<\/code>\u306f\u7c21\u5358\u306b\u30aa\u30f3\u30e9\u30a4\u30f3\u30b7\u30e7\u30c3\u30d7\u304c\u4f5c\u308c\u307e\u3059\u304c\u3001\u3053\u3046\u601d\u3063\u305f\u3053\u3068\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<ul>\n<li>\u300c\u51dd\u3063\u305f\u3053\u3068\u3092\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u5fc5\u8981\u300d<\/li>\n<li>\u300c\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u81ea\u5206\u3067\u3064\u304f\u308b\u306e\u306f\u96e3\u3057\u3044\u300d<\/li>\n<li>\u300c\u30c6\u30fc\u30d6\u30eb\u3092\u9023\u7d50\u3055\u305b\u308b\u65b9\u6cd5\u304c\u308f\u304b\u3089\u306a\u3044\u300d<\/li>\n<\/ul>\n<p>\u79c1\u3082\u9577\u5e74<code>Laravel<\/code>\u3092\u89e6\u3063\u3066\u304d\u307e\u3057\u305f\u3051\u3069\u300c\u3053\u308c\u30db\u30f3\u30c8\u306b\u540c\u3058\u8a00\u8a9e\u306a\u306e!?\u300d\u3068\u601d\u3046\u3050\u3089\u3044\u52dd\u624b\u304c\u9055\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u7279\u306b\u4ee5\u4e0b3\u3064\u306f\u3088\u304f\u72ec\u81ea\u30c7\u30fc\u30bf\u3068\u9023\u643a\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u9867\u5ba2\u30c7\u30fc\u30bf<\/li>\n<li>\u6ce8\u6587\u30c7\u30fc\u30bf<\/li>\n<li>\u5546\u54c1\u30c7\u30fc\u30bf<\/li>\n<\/ul>\n<p>\u4f8b\u3048\u3070\u3001\u9867\u5ba2\u304c\u8208\u5473\u306e\u3042\u308b\u30b8\u30e3\u30f3\u30eb\u3092\u300c<strong>1\uff1a\u591a<\/strong>\u300d\u3067\u9023\u7d50\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u3064\u304f\u308b\u5834\u5408\u3067\u3059\u306d\u3002<\/p>\n<p>\u305f\u3060\u3001\u7e70\u308a\u8fd4\u3057\u306a\u3093\u3067\u3059\u3051\u3069<strong>\u30af\u30bb\u304c\u5f37\u304f\u3066\u308f\u304b\u308a\u306b\u304f\u3044<\/strong>\u3093\u3067\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<br \/>\n\u4eca\u56de\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u3067\u8a18\u4e8b\u3092\u304a\u5c4a\u3051\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>EC-CUBE\u3067\u65e2\u5b58\u30c6\u30fc\u30d6\u30eb\u3068\u9023\u643a\u3057\u305f\u3044<\/li>\n<li>EC-CUBE\u306e\u65e2\u5b58\uff0b\u72ec\u81ea\u30c7\u30fc\u30bf\u3067\u65b0\u3057\u3044\u6a5f\u80fd\u3092\u3064\u304f\u308a\u305f\u3044<\/li>\n<li>EC-CUBE\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u8ca9\u58f2\u3067\u304d\u308b\u5b9f\u7528\u7684\u306a\u3082\u306e\u306b\u3057\u305f\u3044<\/li>\n<\/ul>\n<p>\u305c\u3072\u6700\u5f8c\u307e\u3067\u8aad\u3093\u3067\u304f\u3060\u3055\u3044\u306d\u3002\ud83d\ude0a\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6066 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_23.png\" alt=\"\" width=\"370\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_23.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_23-300x259.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300c\u30de\u30fc\u30b1\u30c6\u30a3\u30f3\u30b0\u8b1b\u5ea7\u3067<br \/>\n\u5b66\u3093\u3060\u3053\u3068\u3092\u5143\u306b\u63d0\u6848\u3057\u305f\u3089\u3001<br \/>\n\u6848\u4ef6\u3092\u7372\u5f97\u3057\u5143\u3092\u3068\u308a\u307e\u3057\u305f\u2757\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> EC-CUBE 4.1<\/p>\n<h2>\u3010EC-CUBE\u30d7\u30e9\u30b0\u30a4\u30f3\u3011\u65e2\u5b58\u30c6\u30fc\u30d6\u30eb\u9023\u643a\u306e\u524d\u63d0<\/h2>\n<p>\u524d\u63d0\u3068\u3057\u3066\u3001\u524d\u56de\u306e<a href=\"https:\/\/blog.capilano-fw.com\/?p=12762\" target=\"_blank\" rel=\"noopener\"><strong>\u3010EC-CUBE 4\u301110\u5206\u3067\u3067\u304d\u308b\uff01\u72ec\u81ea\u30d7\u30e9\u30b0\u30a4\u30f3\u4f5c\u6210<\/strong><\/a>\u3067\u4f5c\u3063\u305f\u30d7\u30e9\u30b0\u30a4\u30f3\u300cLoveYouSukohi\u300d\u3092\u4f7f\u3063\u3066\u958b\u767a\u3092\u9032\u3081\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u88c5\u3059\u308b\u306e\u306f\u5192\u982d\u3067\u3082\u66f8\u3044\u305f\u300c\u9867\u5ba2\u306e\u8208\u5473\u304c\u3042\u308b\u30b8\u30e3\u30f3\u30eb\u300d\u3092\u9023\u7d50\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3002<\/p>\n<p>\u697d\u3057\u3093\u3067\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u2757<\/p>\n<h2>\u3010EC-CUBE\u30d7\u30e9\u30b0\u30a4\u30f3\u3011\u72ec\u81ea\u30c6\u30fc\u30d6\u30eb\u306f\u8a2d\u5b9a\uff06\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067OK<\/h2>\n<p>\u9867\u5ba2\u30c7\u30fc\u30bf\u306b\u300c<strong>1\uff1a\u591a<\/strong>\u300d\u3067\u9023\u7d50\u3059\u308b\u72ec\u81ea\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u524d\u56de\u7d39\u4ecb\u3057\u305f\u3088\u3046\u306b<code>Entity<\/code>\u3067\u3059\u306d\u3002<\/p>\n<p><strong>app\/Plugin\/LoveYouSukohi\/Entity\/LoveYouSukohiCustomerTheme.php<\/strong><\/p>\n<div>\n<pre><strong>&lt;?php<\/strong>\r\n\r\n<strong>namespace Plugin\\LoveYouSukohi\\Entity;<\/strong>\r\n\r\n<strong>use Doctrine\\ORM\\Mapping as ORM;<\/strong>\r\n\r\n<strong>if (! class_exists('\\Plugin\\LoveYouSukohi\\Entity\\LoveYouSukohiCustomerTheme', false)) {<\/strong>\r\n\r\n<strong>    \/**<\/strong>\r\n<strong>     * @ORM\\Table(name=\"plg_love_you_sukohi_customer_theme\")<\/strong>\r\n<strong>     * @ORM\\Entity(repositoryClass=\"Plugin\\LoveYouSukohi\\Repository\\LoveYouSukohiCustomerThemeRepository\")<\/strong>\r\n<strong>     *\/<\/strong>\r\n<strong>    class LoveYouSukohiCustomerTheme<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        \/**<\/strong>\r\n<strong>         * @var int<\/strong>\r\n<strong>         *<\/strong>\r\n<strong>         * @ORM\\Column(name=\"id\", type=\"integer\", options={\"unsigned\":true})<\/strong>\r\n<strong>         * @ORM\\Id<\/strong>\r\n<strong>         * @ORM\\GeneratedValue(strategy=\"IDENTITY\")<\/strong>\r\n<strong>         *\/<\/strong>\r\n<strong>        private $id;<\/strong>\r\n\r\n<strong>        \/**<\/strong>\r\n<strong>         * @var string<\/strong>\r\n<strong>         *<\/strong>\r\n<strong>         * @ORM\\Column(name=\"name\", type=\"string\", length=255, nullable=false)<\/strong>\r\n<strong>         *\/<\/strong>\r\n<strong>        private $name;<\/strong>\r\n\r\n<strong>        \/**<\/strong>\r\n<strong>         * @var \\Eccube\\Entity\\Customer<\/strong>\r\n<strong>         *<\/strong>\r\n<strong>         * @ORM\\ManyToOne(targetEntity=\"Eccube\\Entity\\Customer\", inversedBy=\"LoveYouSukohiCustomerTheme\")<\/strong>\r\n<strong>         * @ORM\\JoinColumn(name=\"customer_id\", referencedColumnName=\"id\", nullable=false)<\/strong>\r\n<strong>         *\/<\/strong>\r\n<strong>        private $customer;<\/strong>\r\n\r\n<strong>        \/**<\/strong>\r\n<strong>         * Get id<\/strong>\r\n<strong>         *<\/strong>\r\n<strong>         * @return int<\/strong>\r\n<strong>         *\/<\/strong>\r\n<strong>        public function getId()<\/strong>\r\n<strong>        {<\/strong>\r\n<strong>            return $this-&gt;id;<\/strong>\r\n<strong>        }<\/strong>\r\n\r\n<strong>        \/**<\/strong>\r\n<strong>         * Get name<\/strong>\r\n<strong>         *<\/strong>\r\n<strong>         * @return string<\/strong>\r\n<strong>         *\/<\/strong>\r\n<strong>        public function getName()<\/strong>\r\n<strong>        {<\/strong>\r\n<strong>            return $this-&gt;name;<\/strong>\r\n<strong>        }<\/strong>\r\n\r\n<strong>        \/**<\/strong>\r\n<strong>         * @return \\Eccube\\Entity\\Customer<\/strong>\r\n<strong>         *\/<\/strong>\r\n<strong>        public function getCustomer()<\/strong>\r\n<strong>        {<\/strong>\r\n<strong>            return $this-&gt;customer;<\/strong>\r\n<strong>        }<\/strong>\r\n\r\n<strong>        \/**<\/strong>\r\n<strong>         * Set name<\/strong>\r\n<strong>         *<\/strong>\r\n<strong>         * @param string $name<\/strong>\r\n<strong>         * @return LoveYouSukohiCustomerTheme<\/strong>\r\n<strong>         *\/<\/strong>\r\n<strong>        public function setName($name)<\/strong>\r\n<strong>        {<\/strong>\r\n<strong>            $this-&gt;name = $name;<\/strong>\r\n\r\n<strong>            return $this;<\/strong>\r\n<strong>        }<\/strong>\r\n\r\n<strong>        \/**<\/strong>\r\n<strong>         * @param \\Eccube\\Entity\\Customer $customer<\/strong>\r\n<strong>         * @return LoveYouSukohiCustomerTheme<\/strong>\r\n<strong>         *\/<\/strong>\r\n<strong>        public function setCustomer($customer)<\/strong>\r\n<strong>        {<\/strong>\r\n<strong>            $this-&gt;customer = $customer;<\/strong>\r\n\r\n<strong>            return $this;<\/strong>\r\n<strong>        }<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong><\/pre>\n<\/div>\n<p>\u3053\u306e\u4e2d\u3067\u8907\u96d1\u306b\u611f\u3058\u308b\u306e\u304c\u4ee5\u4e0b\u306e\u90e8\u5206\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<div>\n<pre><strong>\/**<\/strong>\r\n<strong> * @var \\Eccube\\Entity\\Customer<\/strong>\r\n<strong> *<\/strong>\r\n<strong> * @ORM\\ManyToOne(targetEntity=\"Eccube\\Entity\\Customer\", inversedBy=\"LoveYouSukohiCustomerTheme\")<\/strong>\r\n<strong> * @ORM\\JoinColumn(name=\"customer_id\", referencedColumnName=\"id\", nullable=false)<\/strong>\r\n<strong> *\/<\/strong><\/pre>\n<p>\u5b9f\u306f\u3053\u306e\u90e8\u5206\u3067\u300c<strong>1\uff1a\u591a<\/strong>\u300d\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u72b6\u614b\u3067\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u30c6\u30fc\u30d6\u30eb\u304c\u81ea\u52d5\u3067\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n<div>\n<pre><strong>php bin\/console eccube:plugin:uninstall --code=LoveYouSukohi<\/strong>\r\n<strong>php bin\/console eccube:plugin:install --code=LoveYouSukohi<\/strong>\r\n<strong>php bin\/console eccube:plugin:enable --code=LoveYouSukohi<\/strong>\r\n<strong>php bin\/console cache:clear --no-warmup<\/strong><\/pre>\n<\/div>\n<p>\u5b9f\u969b\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12855\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/ec_cube_plugin_relationship_1.png\" alt=\"\" width=\"477\" height=\"443\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/ec_cube_plugin_relationship_1.png 477w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/ec_cube_plugin_relationship_1-300x279.png 300w\" sizes=\"auto, (max-width: 477px) 100vw, 477px\" \/><\/p>\n<p>\u3053\u3053\u3067\u91cd\u8981\u306a\u306e\u304c\u5916\u90e8\u30ad\u30fc\u304c\u5165\u3063\u3066\u3044\u308b\u3068\u3044\u3046\u90e8\u5206\u3067\u3059\u3002<br \/>\n\u3053\u3053\u306f<code>Laravel<\/code>\u30e9\u30d0\u30fc\u306e\u79c1\u3067\u3082\u6163\u308c\u308c\u3070\u4fbf\u5229\u306a\u306e\u304b\u306a!?\u3068\u611f\u3058\u307e\u3057\u305f\ud83d\ude0a<\/p>\n<h2>\u3010EC-CUBE\u30d7\u30e9\u30b0\u30a4\u30f3\u3011Proxy\u30af\u30e9\u30b9\u65e2\u5b58\u30c6\u30fc\u30d6\u30eb\u3092\u62e1\u5f35\u3059\u308b\u306e\u306f2\u30b9\u30c6\u30c3\u30d7<\/h2>\n<p>\u9867\u5ba2\u30c6\u30fc\u30d6\u30eb<code>dtb_customer<\/code>\u304b\u3089\u300c\u8208\u5473\u306e\u3042\u308b\u300d\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b<code>getThemes()<\/code>\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u2026\u3068\u8a00\u3063\u3066\u3082<code>Customer<\/code>\u306e<code>Entity<\/code>\u306f\u672c\u4f53\u306e\u4e2d\u306b\u3042\u308a\u307e\u3059\u3057\u3001\u4eca\u56de\u306f\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4e2d\u3067\u5b8c\u7d50\u3057\u305f\u3044\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u305d\u3053\u3067\u767b\u5834\u3059\u308b\u306e\u304c\u3001<code>Proxy<\/code>\u30af\u30e9\u30b9\u3002<br \/>\n\u3053\u308c\u306f\u300c<strong>\u65e2\u5b58\u30c6\u30fc\u30d6\u30eb\u3068\u62e1\u5f35\u3057\u305f\u90e8\u5206\u3092\u5408\u4f53\u3057\u305f\u3082\u306e<\/strong>\u300d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u3082\u3068\u3082\u3068<code>Customer<\/code>\u306b\u306f<code>getThemes()<\/code>\u306f\u5b58\u5728\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u72ec\u81ea\u306b\u8ffd\u52a0\u3067\u304d\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<h3>1\uff1a\u62e1\u5f35\u7528\u306eTrait\u3092\u3064\u304f\u308b<\/h3>\n<p><code>Entity<\/code>\u306e\u62e1\u5f35\u306b\u306f<code>Trait<\/code>\u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f<code>Customer<\/code>\u3092\u62e1\u5f35\u3059\u308b\u306e\u3067<code>CustomerTrait<\/code>\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<p><strong>app\/Plugin\/LoveYouSukohi\/Entity\/CustomerTrait.php<\/strong><\/p>\n<div>\n<pre><strong>&lt;?php<\/strong>\r\n\r\n<strong>namespace Plugin\\LoveYouSukohi\\Entity;<\/strong>\r\n\r\n<strong>use Doctrine\\ORM\\Mapping as ORM;<\/strong>\r\n<strong>use Eccube\\Annotation\\EntityExtension;<\/strong>\r\n\r\n<strong>\/**<\/strong>\r\n<strong> * @EntityExtension(\"Eccube\\Entity\\Customer\")<\/strong>\r\n<strong> *\/<\/strong>\r\n<strong>trait CustomerTrait<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    \/**<\/strong>\r\n<strong>     * @var \\Doctrine\\Common\\Collections\\Collection<\/strong>\r\n<strong>     *<\/strong>\r\n<strong>     * @ORM\\OneToMany(targetEntity=\"Plugin\\LoveYouSukohi\\Entity\\LoveYouSukohiCustomerTheme\", mappedBy=\"customer\")<\/strong>\r\n<strong>     *\/<\/strong>\r\n<strong>    private $LoveYouSukohiCustomerTheme;<\/strong>\r\n\r\n<strong>    \/**<\/strong>\r\n<strong>     * @param \\Doctrine\\Common\\Collections\\Collection $LoveYouSukohiCustomerTheme<\/strong>\r\n<strong>     *\/<\/strong>\r\n<strong>    public function getThemes()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return $this-&gt;LoveYouSukohiCustomerTheme;<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong><\/pre>\n<\/div>\n<h3>2\uff1aProxy\u30af\u30e9\u30b9\u3092\u3064\u304f\u308b<\/h3>\n<p><code>Trait<\/code>\u3092\u4f5c\u3063\u305f\u3060\u3051\u3067\u306f<code>Proxy<\/code>\u30af\u30e9\u30b9\u306f\u6709\u52b9\u306b\u306a\u308a\u307e\u305b\u3093\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<div>\n<pre><strong>php bin\/console eccube:generate:proxies<\/strong><\/pre>\n<\/div>\n<p>\u3053\u308c\u3067\u300c<strong>1\uff1a\u591a<\/strong>\u300d\u306e\u9023\u7d50\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\uff01<\/p>\n<h2>\u3010EC-CUBE\u30d7\u30e9\u30b0\u30a4\u30f3\u3011\u65e2\u5b58\uff06\u72ec\u81ea\u306e\u9023\u7d50\u30c7\u30fc\u30bf\u306f\u697d\u306b\u53d6\u308a\u51fa\u305b\u308b<\/h2>\n<p>\u3053\u3053\u304b\u3089\u306f\u9023\u7d50\u304c\u3046\u307e\u304f\u3044\u3063\u3066\u3044\u308b\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>1\uff1a\u9023\u7d50\u30c7\u30fc\u30bf\u3092\u78ba\u8a8d\u3059\u308b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h3>\n<p>\u4eca\u56de\u306f\u30c7\u30fc\u30bf\u53d6\u5f97\u306e\u30c1\u30a7\u30c3\u30af\u3060\u3051\u306a\u306e\u3067\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306f\u4f7f\u308f\u305a\u3001\u7c21\u5358\u306a\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>app\/Plugin\/LoveYouSukohi\/Controller\/CustomerController.php<\/strong><\/p>\n<div>\n<pre><strong>&lt;?php<\/strong>\r\n\r\n<strong>namespace Plugin\\LoveYouSukohi\\Controller;<\/strong>\r\n\r\n<strong>use Eccube\\Controller\\AbstractController;<\/strong>\r\n<strong>use Eccube\\Repository\\CustomerRepository;<\/strong>\r\n<strong>use Symfony\\Component\\Routing\\Annotation\\Route;<\/strong>\r\n\r\n<strong>class CustomerController extends AbstractController<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    private $customerRepository;<\/strong>\r\n\r\n<strong>    public function __construct(CustomerRepository $customerRepository)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $this-&gt;customerRepository = $customerRepository;<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    \/**<\/strong>\r\n<strong>     * @Route(\"\/love_you_sukohi\/customer\", name=\"love_you_sukohi_admin_customer_index\")<\/strong>\r\n<strong>     *\/<\/strong>\r\n<strong>    public function index()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $customer = $this-&gt;customerRepository-&gt;find(1);<\/strong>\r\n<strong>        $themes = $customer-&gt;getThemes();<\/strong>\r\n\r\n<strong>        foreach ($themes as $theme) {<\/strong>\r\n\r\n<strong>            dump($theme-&gt;getName());<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        die();<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong><\/pre>\n<\/div>\n<h3>2\uff1a\u30c6\u30b9\u30c8\u7528\u30c7\u30fc\u30bf\u3092\u30c6\u30fc\u30d6\u30eb\u3078\u8ffd\u52a0\u3059\u308b<\/h3>\n<p>\u304a\u6c17\u306b\u5165\u308a\u306e\u30b8\u30e3\u30f3\u30eb\u306e\u30c7\u30fc\u30bf\u306f\u307e\u3060\u767b\u9332\u3055\u308c\u3066\u3044\u306a\u3044\u306e\u3067<code>plg_love_you_sukohi_customer_theme<\/code>\u306b\u624b\u52d5\u3067\u8ffd\u52a0\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12857\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/ec_cube_plugin_relationship_3.png\" alt=\"\" width=\"488\" height=\"347\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/ec_cube_plugin_relationship_3.png 488w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/ec_cube_plugin_relationship_3-300x213.png 300w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><\/p>\n<h3>3\uff1a\u30d6\u30e9\u30a6\u30b6\u3067\u78ba\u8a8d\u3059\u308b<\/h3>\n<p>\u6e96\u5099\u306f\u6574\u3063\u305f\u306e\u3067\u300c<strong>https:\/\/******\/love_you_sukohi\/customer<\/strong>\u300d\u306b\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-12854\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/ec_cube_plugin_relationship_2.png\" alt=\"\" width=\"354\" height=\"228\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/ec_cube_plugin_relationship_2.png 354w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2024\/07\/ec_cube_plugin_relationship_2-300x193.png 300w\" sizes=\"auto, (max-width: 354px) 100vw, 354px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u3046\u307e\u304f\u9023\u7d50\u3057\u305f\u30c7\u30fc\u30bf\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5ff5\u306e\u305f\u3081\u5225\u306e\u30e6\u30fc\u30b6\u30fc\u3067\u3082\u8a66\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<div>\n<pre><strong>$customer = $this-&gt;customerRepository-&gt;find(2);<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p>\u30d6\u30e9\u30f3\u30af\u30da\u30fc\u30b8\u306b\u306a\u308a\u307e\u3057\u305f\uff08\u306e\u3067\u753b\u50cf\u306f\u3042\u308a\u307e\u305b\u3093\uff09<\/p>\n<p>\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<h2>\u3010EC-CUBE\u30d7\u30e9\u30b0\u30a4\u30f3\u3011\u958b\u767a\u3057\u305f\u3044\u4f01\u696d\u69d8\u3078\u306e\u63d0\u6848<\/h2>\n<p>\u4eca\u56de\u306f\u57fa\u790e\u306e\u5185\u5bb9\u3067\u3057\u305f\u304c\u3001\u30c6\u30fc\u30d6\u30eb\u9023\u7d50\u3092\u3064\u304b\u3048\u3070\u4ee5\u4e0b5\u3064\u306e\u3088\u3046\u306a\u30de\u30fc\u30b1\u30c6\u30a3\u30f3\u30b0\u65bd\u7b56\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30ab\u30fc\u30c8\u8ffd\u52a0\u3057\u305f\u306e\u306b\u8cb7\u308f\u306a\u304b\u3063\u305f\u5546\u54c1\u3092\u30e1\u30fc\u30eb\u901a\u77e5<\/li>\n<li>\u4f55\u5ea6\u3082\u95b2\u89a7\u3057\u305f\u5546\u54c1\u3092\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306b\u8868\u793a<\/li>\n<li>\u30ad\u30e3\u30f3\u30da\u30fc\u30f3\u306b\u53c2\u52a0\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u9650\u5b9a\u30da\u30fc\u30b8<\/li>\n<li>\u30bb\u30b0\u30e1\u30f3\u30c8\u30c7\u30fc\u30bf\u3067\u8ca9\u58f2\u4fc3\u9032\u306b\u5229\u7528\u3059\u308b<\/li>\n<li>\u30af\u30ec\u30fc\u30e0\u5185\u5bb9\u3092\u7ba1\u7406\u3057\u3001\u30ab\u30b9\u30bf\u30de\u30fc\u30b5\u30dd\u30fc\u30c8\u306b\u5f79\u7acb\u3066\u308b<\/li>\n<\/ul>\n<p>\u305c\u3072\u3053\u3046\u3044\u3063\u305f\u65bd\u7b56\u3092\u3057\u305f\u3044\u65b9\u306f\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044\u3002<br \/>\n\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002\ud83d\ude0a\u2728<\/p>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f<code>EC-CUBE<\/code>\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u304b\u3089\u65e2\u5b58\u30c6\u30fc\u30d6\u30eb\u3068\u9023\u7d50\u3057\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><code>Laravel<\/code>\u3092\u4f7f\u3063\u3066\u3044\u308b\u3068<code>hasMany()<\/code>\u306e\u3088\u3046\u306b\u76f4\u611f\u7684\u306b\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308c\u308b\u306e\u3067\u6700\u521d\u306f\u3068\u307e\u3069\u3044\u307e\u3059\u304c\u3001\u6163\u308c\u308b\u3068\u3053\u308c\u3082\u60aa\u304f\u306f\u306a\u3044\u306e\u304b\u306a\u3068\u3044\u3063\u305f\u5370\u8c61\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u3084\u306f\u308a\u3082\u3046\u5c11\u3057<code>EC-CUBE<\/code>\u306b\u95a2\u3059\u308b\u60c5\u5831\u304c\u591a\u304f\u51fa\u56de\u3063\u3066\u3044\u3066\u307b\u3057\u3044\u3082\u306e\u3067\u3059\u3002\u3002<\/p>\n<p>\u4f7f\u3044\u3084\u3059\u3044\u306e\u3067\u5c0e\u5165\u306f\u7c21\u5358\u3067\u3059\u304c\u3001\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u304c\u96e3\u3057\u3044\u306e\u3067\u4ed5\u4e8b\u3068\u3057\u3066\u52c9\u5f37\u3059\u308b\u306e\u3082\u60aa\u304f\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300c<code>WritingHacks<\/code>\u3067\u52c9\u5f37\u3057\u305f\u3089\u3001<br \/>\n\u540c\u3058\u60c5\u5831\u91cf\u3067<br \/>\n\u77ed\u3044\u6587\u7ae0\u304c\u66f8\u3051\u308b\u3088\u3046\u306b\uff01\u300d<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001EC-CUBE\u306f\u7c21\u5358\u306b\u30aa\u30f3\u30e9\u30a4\u30f3\u30b7\u30e7\u30c3\u30d7\u304c\u4f5c\u308c\u307e\u3059\u304c\u3001\u3053\u3046\u601d\u3063\u305f\u3053\u3068\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002 \u300c\u51dd\u3063\u305f\u3053\u3068\u3092\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30d7\u30e9\u30b0\u30a4\u30f3\u304c\u5fc5\u8981\u300d \u300c\u30d7\u30e9\u30b0\u30a4\u30f3\u3092 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=12850\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010EC-CUBE\u30d7\u30e9\u30b0\u30a4\u30f3\u3011\u65e2\u5b58\u3068\u72ec\u81ea\u30c6\u30fc\u30d6\u30eb\u3092\u7d50\u5408\u3059\u308b5\u30b9\u30c6\u30c3\u30d7&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":12862,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[260,258],"tags":[],"class_list":["post-12850","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ec-cube","category-258"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/12850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12850"}],"version-history":[{"count":27,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/12850\/revisions"}],"predecessor-version":[{"id":12937,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/12850\/revisions\/12937"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/12862"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}