Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

エンティティ拡張機構の実装 #2267

Merged
merged 8 commits into from Apr 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/Acme/Entity/DbTrait.php
@@ -0,0 +1,18 @@
<?php

namespace Acme\Entity;

use Doctrine\ORM\Mapping as ORM;
use Eccube\Annotation as Eccube;

/**
* @Eccube\EntityExtension("Eccube\Entity\Product")
*/
trait DbTrait
{
/**
* @ORM\ManyToOne(targetEntity="\Eccube\Entity\Master\Db")
* @ORM\JoinColumn(name="database_id", referencedColumnName="id")
*/
public $DataBase;
}
22 changes: 22 additions & 0 deletions app/Acme/Entity/MakerTrait.php
@@ -0,0 +1,22 @@
<?php

namespace Acme\Entity;

use Doctrine\ORM\Mapping as ORM;
use Eccube\Annotation as Eccube;

/**
* @Eccube\EntityExtension("Eccube\Entity\Product")
*/
trait MakerTrait
{
/**
* @ORM\Column(type="string", nullable=true)
*/
public $maker_name;

/**
* @ORM\Column(type="string", nullable=true)
*/
public $maker_url;
}
2 changes: 1 addition & 1 deletion app/Acme/Entity/SoldOutEventListener.php
Expand Up @@ -6,7 +6,7 @@

use Doctrine\ORM\Event\LifecycleEventArgs;
use Doctrine\ORM\Event\PreUpdateEventArgs;
use Eccube\Entity\Event\Annotations\PreUpdate;
use Eccube\Annotation\PreUpdate;
use Eccube\Entity\Event\EntityEventListener;
use Eccube\Entity\ProductStock;

Expand Down
1 change: 1 addition & 0 deletions app/console
Expand Up @@ -36,5 +36,6 @@ $console->add(new Eccube\Command\RouterCommand());
$console->add(new Eccube\Command\CacheClearCommand());
$console->add(new Eccube\Command\PluginCommand());
$console->add(new Eccube\Command\ConfigCommand());
$console->add(new Eccube\Command\GenerateProxyCommand());

$console->run();
Empty file added app/proxy/entity/.gitkeep
Empty file.
2 changes: 2 additions & 0 deletions cli-config.php
Expand Up @@ -21,6 +21,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

require_once __DIR__.'/autoload.php';

use Doctrine\ORM\Tools\Console\ConsoleRunner;

$app = \Eccube\Application::getInstance();
Expand Down
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -77,6 +77,7 @@
"autoload": {
"files": [ "src/Eccube/Resource/functions/log.php" ],
"psr-4": {
"Eccube\\Entity\\": "app/proxy/entity",
"Eccube\\": "src/Eccube",
"Acme\\": "app/Acme",
"Plugin\\": "app/Plugin",
Expand Down