From 9099b2714395a7b80dac437e5da4d707c2d2fb95 Mon Sep 17 00:00:00 2001 From: Hama Date: Tue, 4 Oct 2016 19:08:53 +0900 Subject: [PATCH 1/7] =?UTF-8?q?=E3=82=A8=E3=83=B3=E3=83=86=E3=82=A3?= =?UTF-8?q?=E3=83=86=E3=82=A3=E7=B6=99=E6=89=BF=E6=A9=9F=E8=83=BD=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Eccube/Application.php | 40 ++++++-- .../ORM/Mapping/Driver/YamlDriver.php | 97 ++++++++++++++++++ src/Eccube/Entity/AuthorityRole.php | 12 +-- src/Eccube/Entity/BaseInfo.php | 80 +++++++-------- src/Eccube/Entity/Block.php | 18 ++-- src/Eccube/Entity/BlockPosition.php | 14 +-- src/Eccube/Entity/Cart.php | 8 +- src/Eccube/Entity/CartItem.php | 10 +- src/Eccube/Entity/Category.php | 22 ++--- src/Eccube/Entity/CategoryCount.php | 6 +- src/Eccube/Entity/CategoryTotalCount.php | 6 +- src/Eccube/Entity/ClassCategory.php | 16 +-- src/Eccube/Entity/ClassName.php | 16 +-- src/Eccube/Entity/Csv.php | 22 ++--- src/Eccube/Entity/Customer.php | 80 +++++++-------- src/Eccube/Entity/CustomerAddress.php | 46 ++++----- src/Eccube/Entity/CustomerFavoriteProduct.php | 12 +-- src/Eccube/Entity/Delivery.php | 28 +++--- src/Eccube/Entity/DeliveryDate.php | 8 +- src/Eccube/Entity/DeliveryFee.php | 8 +- src/Eccube/Entity/DeliveryTime.php | 6 +- src/Eccube/Entity/Help.php | 62 ++++++------ src/Eccube/Entity/MailHistory.php | 14 +-- src/Eccube/Entity/MailTemplate.php | 20 ++-- src/Eccube/Entity/Master/Authority.php | 6 +- src/Eccube/Entity/Master/Country.php | 6 +- src/Eccube/Entity/Master/CsvType.php | 6 +- .../Entity/Master/CustomerOrderStatus.php | 6 +- src/Eccube/Entity/Master/CustomerStatus.php | 6 +- src/Eccube/Entity/Master/Db.php | 6 +- src/Eccube/Entity/Master/DeviceType.php | 6 +- src/Eccube/Entity/Master/Disp.php | 6 +- src/Eccube/Entity/Master/Job.php | 6 +- src/Eccube/Entity/Master/OrderStatus.php | 6 +- src/Eccube/Entity/Master/OrderStatusColor.php | 6 +- src/Eccube/Entity/Master/PageMax.php | 6 +- src/Eccube/Entity/Master/Pref.php | 6 +- src/Eccube/Entity/Master/ProductListMax.php | 6 +- .../Entity/Master/ProductListOrderBy.php | 6 +- src/Eccube/Entity/Master/ProductType.php | 6 +- src/Eccube/Entity/Master/Sex.php | 6 +- src/Eccube/Entity/Master/Tag.php | 8 +- src/Eccube/Entity/Master/Taxrule.php | 6 +- src/Eccube/Entity/Master/Work.php | 6 +- src/Eccube/Entity/Master/Zip.php | 10 +- src/Eccube/Entity/Member.php | 28 +++--- src/Eccube/Entity/News.php | 24 ++--- src/Eccube/Entity/Order.php | 98 +++++++++---------- src/Eccube/Entity/OrderDetail.php | 30 +++--- src/Eccube/Entity/PageLayout.php | 28 +++--- src/Eccube/Entity/Payment.php | 28 +++--- src/Eccube/Entity/PaymentOption.php | 10 +- src/Eccube/Entity/Plugin.php | 32 +++--- src/Eccube/Entity/PluginEventHandler.php | 20 ++-- src/Eccube/Entity/Product.php | 60 ++++++------ src/Eccube/Entity/ProductCategory.php | 10 +- src/Eccube/Entity/ProductClass.php | 46 ++++----- src/Eccube/Entity/ProductImage.php | 12 +-- src/Eccube/Entity/ProductStock.php | 14 +-- src/Eccube/Entity/ProductTag.php | 10 +- src/Eccube/Entity/ShipmentItem.php | 28 +++--- src/Eccube/Entity/Shipping.php | 66 ++++++------- src/Eccube/Entity/TaxRule.php | 28 +++--- src/Eccube/Entity/Template.php | 12 +-- 64 files changed, 743 insertions(+), 624 deletions(-) diff --git a/src/Eccube/Application.php b/src/Eccube/Application.php index a32eb1b0152..fd07e4f953d 100644 --- a/src/Eccube/Application.php +++ b/src/Eccube/Application.php @@ -416,15 +416,13 @@ public function initDoctrine() ->directories() ->depth(0); - $ormMappings = array(); - $ormMappings[] = array( - 'type' => 'yml', - 'namespace' => 'Eccube\Entity', - 'path' => array( - __DIR__.'/Resource/doctrine', - __DIR__.'/Resource/doctrine/master', - ), + $basePaths = array( + __DIR__.'/Resource/doctrine', + __DIR__.'/Resource/doctrine/master', ); + $ormMappings = array(); + $pluginMappings = array(); + $allPaths = array(); foreach ($finder as $dir) { @@ -444,14 +442,27 @@ public function initDoctrine() foreach ($config['orm.path'] as $path) { $paths[] = $pluginBasePath.'/'.$config['code'].$path; } - $ormMappings[] = array( + $pluginMappings[] = array( 'type' => 'yml', 'namespace' => 'Plugin\\'.$config['code'].'\\Entity', 'path' => $paths, ); + $allPaths = array_merge($allPaths, $paths); } } + $ormMappings[] = array( + 'type' => 'yml', + 'namespace' => 'Eccube\Entity', + 'path' => array_merge($basePaths, $allPaths), + ); + + foreach ($pluginMappings as &$pluginMapping) { + $pluginMapping['path'] = array_unique(array_merge($pluginMapping['path'], $allPaths, $basePaths)); + } + + $ormMappings = array_merge($ormMappings, $pluginMappings); + $options = array( 'mappings' => $ormMappings ); @@ -926,6 +937,17 @@ public function loadPlugin() $this->register(new $class($this)); } } + if (isset($config['extended_entities'])) { + foreach ($config['extended_entities'] as $entity) { + $driverChain = $this['orm.em']->getConfiguration()->getMetadataDriverImpl(); + $drivers = $driverChain->getDrivers(); + foreach ($drivers as $namespace => $driver) { + if ($driver instanceof \Eccube\Doctrine\ORM\Mapping\Driver\YamlDriver) { + $driver->addExtendedEntity($entity); + } + } + } + } } } diff --git a/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php index 0f26f06eee7..55220c40429 100644 --- a/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -42,4 +42,101 @@ protected function loadMappingFile($file) { return Yaml::parse(file_get_contents($file)); } + + /** + * @var array + */ + protected $extendedEntities = array(); + + /** + * Setter for extendedEntities. + * + * @param string $extendedEntity + * + * @return $this + */ + public function addExtendedEntity($extendedEntity) + { + if (!in_array($extendedEntity, $this->extendedEntities, true)) { + $this->extendedEntities[] = $extendedEntity; + } + return $this; + } + + /** + * {@inheritDoc} + */ + public function getAllClassNames() + { + $driver = $this; + $classNames = parent::getAllClassNames(); + return array_filter( + $classNames, + function ($className) use ($driver) { + return !in_array($className, $driver->extendedEntities, true); + } + ); + } + + /** + * Returns whether the class with the specified name is transient. Only non-transient + * classes, that is entities and mapped superclasses, should have their metadata loaded. + * + * A class is non-transient if it is annotated with an annotation + * from the {@see AnnotationDriver::entityAnnotationClasses}. + * + * @param string $className + * + * @return boolean + */ + public function isTransient($className) + { + $isTransient = parent::isTransient($className); + if (!$isTransient && in_array($className, $this->extendedEntities, true)) { + $isTransient = true; + } + return $isTransient; + } + + /** + * Gets the element of schema meta data for the class from the mapping file. + * This will lazily load the mapping file if it is not loaded yet. + * + * Overridden in order to merger mapping with parent class if 'extended_entity' is provided. + * + * @param string $className + * + * @return array The element of schema meta data. + */ + public function getElement($className) + { + $result = parent::getElement($className); + if (isset($result['extended_entity'])) { + $extendedElement = $this->getElement($result['extended_entity']); + unset($result['extended_entity']); + $result = $this->mergeMappings($extendedElement, $result); + } + return $result; + } + + /** + * Merges mappings recursively and overrides duplicated values with second mappings values. + * + * @param array $mapping1 + * @param array $mapping2 + * + * @return array + */ + protected function mergeMappings(array &$mapping1, array &$mapping2) + { + $merged = $mapping1; + foreach ($mapping2 as $key => &$value) { + if (is_array ($value) && isset($merged[$key]) && is_array($merged[$key])) { + $merged[$key] = $this->mergeMappings($merged[$key], $value); + } else { + $merged[$key] = $value; + } + } + return $merged; + } } \ No newline at end of file diff --git a/src/Eccube/Entity/AuthorityRole.php b/src/Eccube/Entity/AuthorityRole.php index 97a18c5deda..880ae67df35 100644 --- a/src/Eccube/Entity/AuthorityRole.php +++ b/src/Eccube/Entity/AuthorityRole.php @@ -12,32 +12,32 @@ class AuthorityRole extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $deny_url; + protected $deny_url; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var \Eccube\Entity\Master\Authority */ - private $Authority; + protected $Authority; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** diff --git a/src/Eccube/Entity/BaseInfo.php b/src/Eccube/Entity/BaseInfo.php index e8e1811e921..23016cbb264 100644 --- a/src/Eccube/Entity/BaseInfo.php +++ b/src/Eccube/Entity/BaseInfo.php @@ -32,202 +32,202 @@ class BaseInfo extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $company_name; + protected $company_name; /** * @var string */ - private $company_kana; + protected $company_kana; /** * @var string */ - private $zip01; + protected $zip01; /** * @var string */ - private $zip02; + protected $zip02; /** * @var string */ - private $zipcode; + protected $zipcode; /** * @var string */ - private $addr01; + protected $addr01; /** * @var string */ - private $addr02; + protected $addr02; /** * @var string */ - private $tel01; + protected $tel01; /** * @var string */ - private $tel02; + protected $tel02; /** * @var string */ - private $tel03; + protected $tel03; /** * @var string */ - private $fax01; + protected $fax01; /** * @var string */ - private $fax02; + protected $fax02; /** * @var string */ - private $fax03; + protected $fax03; /** * @var string */ - private $business_hour; + protected $business_hour; /** * @var string */ - private $email01; + protected $email01; /** * @var string */ - private $email02; + protected $email02; /** * @var string */ - private $email03; + protected $email03; /** * @var string */ - private $email04; + protected $email04; /** * @var string */ - private $shop_name; + protected $shop_name; /** * @var string */ - private $shop_kana; + protected $shop_kana; /** * @var string */ - private $shop_name_eng; + protected $shop_name_eng; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var string */ - private $good_traded; + protected $good_traded; /** * @var string */ - private $message; + protected $message; /** * @var string */ - private $latitude; + protected $latitude; /** * @var string */ - private $longitude; + protected $longitude; /** * @var string */ - private $delivery_free_amount; + protected $delivery_free_amount; /** * @var integer */ - private $delivery_free_quantity; + protected $delivery_free_quantity; /** * @var integer */ - private $option_multiple_shipping; + protected $option_multiple_shipping; /** * @var integer */ - private $option_mypage_order_status_display; + protected $option_mypage_order_status_display; /** * @var integer */ - private $nostock_hidden; + protected $nostock_hidden; /** * @var integer */ - private $option_favorite_product; + protected $option_favorite_product; /** * @var integer */ - private $option_product_delivery_fee; + protected $option_product_delivery_fee; /** * @var integer */ - private $option_product_tax_rule; + protected $option_product_tax_rule; /** * @var integer */ - private $option_customer_activate; + protected $option_customer_activate; /** * @var integer */ - private $option_remember_me; + protected $option_remember_me; /** * @var string */ - private $authentication_key; + protected $authentication_key; /** * @var \Eccube\Entity\Master\Country */ - private $Country; + protected $Country; /** * @var \Eccube\Entity\Master\Pref */ - private $Pref; + protected $Pref; /** diff --git a/src/Eccube/Entity/Block.php b/src/Eccube/Entity/Block.php index b6aebaff687..2ba6411d984 100644 --- a/src/Eccube/Entity/Block.php +++ b/src/Eccube/Entity/Block.php @@ -17,47 +17,47 @@ class Block extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var string */ - private $file_name; + protected $file_name; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var integer */ - private $logic_flg; + protected $logic_flg; /** * @var integer */ - private $deletable_flg; + protected $deletable_flg; /** * @var \Doctrine\Common\Collections\Collection */ - private $BlockPositions; + protected $BlockPositions; /** * @var \Eccube\Entity\Master\DeviceType */ - private $DeviceType; + protected $DeviceType; /** * Constructor diff --git a/src/Eccube/Entity/BlockPosition.php b/src/Eccube/Entity/BlockPosition.php index c55afc666db..b2ab37006e2 100644 --- a/src/Eccube/Entity/BlockPosition.php +++ b/src/Eccube/Entity/BlockPosition.php @@ -12,37 +12,37 @@ class BlockPosition extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $page_id; + protected $page_id; /** * @var integer */ - private $target_id; + protected $target_id; /** * @var integer */ - private $block_id; + protected $block_id; /** * @var integer */ - private $block_row; + protected $block_row; /** * @var integer */ - private $anywhere; + protected $anywhere; /** * @var \Eccube\Entity\Block */ - private $Block; + protected $Block; /** * @var \Eccube\Entity\PageLayout */ - private $PageLayout; + protected $PageLayout; /** diff --git a/src/Eccube/Entity/Cart.php b/src/Eccube/Entity/Cart.php index b5287c36a9a..51d6a367aed 100644 --- a/src/Eccube/Entity/Cart.php +++ b/src/Eccube/Entity/Cart.php @@ -29,22 +29,22 @@ class Cart extends \Eccube\Entity\AbstractEntity /** * @var bool */ - private $lock = false; + protected $lock = false; /** * @var \Doctrine\Common\Collections\ArrayCollection */ - private $CartItems; + protected $CartItems; /** * @var string */ - private $pre_order_id = null; + protected $pre_order_id = null; /** * @var array */ - private $Payments = array(); + protected $Payments = array(); public function __construct() { diff --git a/src/Eccube/Entity/CartItem.php b/src/Eccube/Entity/CartItem.php index b27e3bdc385..1551d5c6115 100644 --- a/src/Eccube/Entity/CartItem.php +++ b/src/Eccube/Entity/CartItem.php @@ -27,11 +27,11 @@ class CartItem extends \Eccube\Entity\AbstractEntity { - private $class_name; - private $class_id; - private $price; - private $quantity; - private $object; + protected $class_name; + protected $class_id; + protected $price; + protected $quantity; + protected $object; public function __construct() { diff --git a/src/Eccube/Entity/Category.php b/src/Eccube/Entity/Category.php index 07837f54b13..d4e346b75f2 100644 --- a/src/Eccube/Entity/Category.php +++ b/src/Eccube/Entity/Category.php @@ -127,57 +127,57 @@ public function getSelfAndDescendants() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $level; + protected $level; /** * @var integer */ - private $rank; + protected $rank; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \Doctrine\Common\Collections\Collection */ - private $ProductCategories; + protected $ProductCategories; /** * @var \Doctrine\Common\Collections\Collection */ - private $Children; + protected $Children; /** * @var \Eccube\Entity\Category */ - private $Parent; + protected $Parent; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** * Constructor diff --git a/src/Eccube/Entity/CategoryCount.php b/src/Eccube/Entity/CategoryCount.php index 24f90029c58..28cb1a9ba2c 100644 --- a/src/Eccube/Entity/CategoryCount.php +++ b/src/Eccube/Entity/CategoryCount.php @@ -34,17 +34,17 @@ class CategoryCount extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $category_id; + protected $category_id; /** * @var integer */ - private $product_count; + protected $product_count; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * Get category_id diff --git a/src/Eccube/Entity/CategoryTotalCount.php b/src/Eccube/Entity/CategoryTotalCount.php index dd0b71fce7d..d0d800d6f1c 100644 --- a/src/Eccube/Entity/CategoryTotalCount.php +++ b/src/Eccube/Entity/CategoryTotalCount.php @@ -34,17 +34,17 @@ class CategoryTotalCount extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $category_id; + protected $category_id; /** * @var integer */ - private $product_count; + protected $product_count; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * Get category_id diff --git a/src/Eccube/Entity/ClassCategory.php b/src/Eccube/Entity/ClassCategory.php index 5d5712900a9..94ae9867f34 100644 --- a/src/Eccube/Entity/ClassCategory.php +++ b/src/Eccube/Entity/ClassCategory.php @@ -40,42 +40,42 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \Eccube\Entity\ClassName */ - private $ClassName; + protected $ClassName; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** * Get id diff --git a/src/Eccube/Entity/ClassName.php b/src/Eccube/Entity/ClassName.php index bd7fe57223a..54cd4d2c687 100644 --- a/src/Eccube/Entity/ClassName.php +++ b/src/Eccube/Entity/ClassName.php @@ -40,42 +40,42 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \Doctrine\Common\Collections\Collection */ - private $ClassCategories; + protected $ClassCategories; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** * Constructor diff --git a/src/Eccube/Entity/Csv.php b/src/Eccube/Entity/Csv.php index b63c0690ffa..9400e427a0a 100644 --- a/src/Eccube/Entity/Csv.php +++ b/src/Eccube/Entity/Csv.php @@ -12,57 +12,57 @@ class Csv extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $entity_name; + protected $entity_name; /** * @var string */ - private $field_name; + protected $field_name; /** * @var string */ - private $reference_field_name; + protected $reference_field_name; /** * @var string */ - private $disp_name; + protected $disp_name; /** * @var integer */ - private $rank; + protected $rank; /** * @var integer */ - private $enable_flg; + protected $enable_flg; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var \Eccube\Entity\Master\CsvType */ - private $CsvType; + protected $CsvType; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** diff --git a/src/Eccube/Entity/Customer.php b/src/Eccube/Entity/Customer.php index bdffd93bd86..8360a6db234 100644 --- a/src/Eccube/Entity/Customer.php +++ b/src/Eccube/Entity/Customer.php @@ -40,202 +40,202 @@ class Customer extends \Eccube\Entity\AbstractEntity implements UserInterface /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name01; + protected $name01; /** * @var string */ - private $name02; + protected $name02; /** * @var string */ - private $kana01; + protected $kana01; /** * @var string */ - private $kana02; + protected $kana02; /** * @var string */ - private $company_name; + protected $company_name; /** * @var string */ - private $zip01; + protected $zip01; /** * @var string */ - private $zip02; + protected $zip02; /** * @var string */ - private $zipcode; + protected $zipcode; /** * @var string */ - private $addr01; + protected $addr01; /** * @var string */ - private $addr02; + protected $addr02; /** * @var string */ - private $email; + protected $email; /** * @var string */ - private $tel01; + protected $tel01; /** * @var string */ - private $tel02; + protected $tel02; /** * @var string */ - private $tel03; + protected $tel03; /** * @var string */ - private $fax01; + protected $fax01; /** * @var string */ - private $fax02; + protected $fax02; /** * @var string */ - private $fax03; + protected $fax03; /** * @var \DateTime */ - private $birth; + protected $birth; /** * @var string */ - private $password; + protected $password; /** * @var string */ - private $salt; + protected $salt; /** * @var string */ - private $secret_key; + protected $secret_key; /** * @var \DateTime */ - private $first_buy_date; + protected $first_buy_date; /** * @var \DateTime */ - private $last_buy_date; + protected $last_buy_date; /** * @var string */ - private $buy_times; + protected $buy_times; /** * @var string */ - private $buy_total; + protected $buy_total; /** * @var string */ - private $note; + protected $note; /** * @var string */ - private $reset_key; + protected $reset_key; /** * @var \DateTime */ - private $reset_expire; + protected $reset_expire; /** * @var \Eccube\Entity\Master\CustomerStatus */ - private $Status; + protected $Status; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \Eccube\Entity\Master\Sex */ - private $Sex; + protected $Sex; /** * @var \Eccube\Entity\Master\Job */ - private $Job; + protected $Job; /** * @var \Eccube\Entity\Master\Country */ - private $Country; + protected $Country; /** * @var \Eccube\Entity\Master\Pref */ - private $Pref; + protected $Pref; /** * @var \Doctrine\Common\Collections\Collection */ - private $CustomerFavoriteProducts; + protected $CustomerFavoriteProducts; /** * @var \Doctrine\Common\Collections\Collection */ - private $CustomerAddresses; + protected $CustomerAddresses; /** * @var \Doctrine\Common\Collections\Collection */ - private $Orders; + protected $Orders; /** * Constructor diff --git a/src/Eccube/Entity/CustomerAddress.php b/src/Eccube/Entity/CustomerAddress.php index 9c18b085053..949b417e356 100644 --- a/src/Eccube/Entity/CustomerAddress.php +++ b/src/Eccube/Entity/CustomerAddress.php @@ -34,117 +34,117 @@ class CustomerAddress extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name01; + protected $name01; /** * @var string */ - private $name02; + protected $name02; /** * @var string */ - private $kana01; + protected $kana01; /** * @var string */ - private $kana02; + protected $kana02; /** * @var string */ - private $company_name; + protected $company_name; /** * @var string */ - private $zip01; + protected $zip01; /** * @var string */ - private $zip02; + protected $zip02; /** * @var string */ - private $zipcode; + protected $zipcode; /** * @var string */ - private $addr01; + protected $addr01; /** * @var string */ - private $addr02; + protected $addr02; /** * @var string */ - private $tel01; + protected $tel01; /** * @var string */ - private $tel02; + protected $tel02; /** * @var string */ - private $tel03; + protected $tel03; /** * @var string */ - private $fax01; + protected $fax01; /** * @var string */ - private $fax02; + protected $fax02; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var string */ - private $fax03; + protected $fax03; /** * @var \Eccube\Entity\Customer */ - private $Customer; + protected $Customer; /** * @var \Eccube\Entity\Master\Country */ - private $Country; + protected $Country; /** * @var \Eccube\Entity\Master\Pref */ - private $Pref; + protected $Pref; public function __construct() { diff --git a/src/Eccube/Entity/CustomerFavoriteProduct.php b/src/Eccube/Entity/CustomerFavoriteProduct.php index c5054a5d5ce..3c6c457e5c3 100644 --- a/src/Eccube/Entity/CustomerFavoriteProduct.php +++ b/src/Eccube/Entity/CustomerFavoriteProduct.php @@ -32,32 +32,32 @@ class CustomerFavoriteProduct extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \Eccube\Entity\Customer */ - private $Customer; + protected $Customer; /** * @var \Eccube\Entity\Product */ - private $Product; + protected $Product; /** * Get id diff --git a/src/Eccube/Entity/Delivery.php b/src/Eccube/Entity/Delivery.php index 01d1929772f..e445daa04d9 100644 --- a/src/Eccube/Entity/Delivery.php +++ b/src/Eccube/Entity/Delivery.php @@ -32,72 +32,72 @@ class Delivery extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var string */ - private $service_name; + protected $service_name; /** * @var string */ - private $description; + protected $description; /** * @var string */ - private $confirm_url; + protected $confirm_url; /** * @var integer */ - private $rank; + protected $rank; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var \Eccube\Entity\Master\ProductType */ - private $ProductType; + protected $ProductType; /** * @var \Doctrine\Common\Collections\Collection */ - private $DeliveryFees; + protected $DeliveryFees; /** * @var \Doctrine\Common\Collections\Collection */ - private $DeliveryTimes; + protected $DeliveryTimes; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** * @var \Doctrine\Common\Collections\Collection */ - private $PaymentOptions; + protected $PaymentOptions; /** * Constructor diff --git a/src/Eccube/Entity/DeliveryDate.php b/src/Eccube/Entity/DeliveryDate.php index af4fa92cdbe..53f8da01b25 100644 --- a/src/Eccube/Entity/DeliveryDate.php +++ b/src/Eccube/Entity/DeliveryDate.php @@ -20,22 +20,22 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $value; + protected $value; /** * @var integer */ - private $rank; + protected $rank; /** diff --git a/src/Eccube/Entity/DeliveryFee.php b/src/Eccube/Entity/DeliveryFee.php index 1ac7258d675..210db2a0bff 100644 --- a/src/Eccube/Entity/DeliveryFee.php +++ b/src/Eccube/Entity/DeliveryFee.php @@ -32,22 +32,22 @@ class DeliveryFee extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $fee; + protected $fee; /** * @var \Eccube\Entity\Delivery */ - private $Delivery; + protected $Delivery; /** * @var \Eccube\Entity\Master\Pref */ - private $Pref; + protected $Pref; /** * Get id diff --git a/src/Eccube/Entity/DeliveryTime.php b/src/Eccube/Entity/DeliveryTime.php index 9b30e6cf57b..cae6f8f293e 100644 --- a/src/Eccube/Entity/DeliveryTime.php +++ b/src/Eccube/Entity/DeliveryTime.php @@ -32,17 +32,17 @@ class DeliveryTime extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $delivery_time; + protected $delivery_time; /** * @var \Eccube\Entity\Delivery */ - private $Delivery; + protected $Delivery; /** * Get id diff --git a/src/Eccube/Entity/Help.php b/src/Eccube/Entity/Help.php index 827be07ff73..a400a504249 100644 --- a/src/Eccube/Entity/Help.php +++ b/src/Eccube/Entity/Help.php @@ -33,157 +33,157 @@ class Help extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $customer_agreement; + protected $customer_agreement; /** * @var string */ - private $law_company; + protected $law_company; /** * @var string */ - private $law_manager; + protected $law_manager; /** * @var string */ - private $law_zip01; + protected $law_zip01; /** * @var string */ - private $law_zip02; + protected $law_zip02; /** * @var string */ - private $law_zipcode; + protected $law_zipcode; /** * @var string */ - private $law_addr01; + protected $law_addr01; /** * @var string */ - private $law_addr02; + protected $law_addr02; /** * @var string */ - private $law_tel01; + protected $law_tel01; /** * @var string */ - private $law_tel02; + protected $law_tel02; /** * @var string */ - private $law_tel03; + protected $law_tel03; /** * @var string */ - private $law_fax01; + protected $law_fax01; /** * @var string */ - private $law_fax02; + protected $law_fax02; /** * @var string */ - private $law_fax03; + protected $law_fax03; /** * @var string */ - private $law_email; + protected $law_email; /** * @var string */ - private $law_url; + protected $law_url; /** * @var string */ - private $law_term01; + protected $law_term01; /** * @var string */ - private $law_term02; + protected $law_term02; /** * @var string */ - private $law_term03; + protected $law_term03; /** * @var string */ - private $law_term04; + protected $law_term04; /** * @var string */ - private $law_term05; + protected $law_term05; /** * @var string */ - private $law_term06; + protected $law_term06; /** * @var string */ - private $law_term07; + protected $law_term07; /** * @var string */ - private $law_term08; + protected $law_term08; /** * @var string */ - private $law_term09; + protected $law_term09; /** * @var string */ - private $law_term10; + protected $law_term10; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var \Eccube\Entity\Master\Country */ - private $LawCountry; + protected $LawCountry; /** * @var \Eccube\Entity\Master\Pref */ - private $LawPref; + protected $LawPref; /** diff --git a/src/Eccube/Entity/MailHistory.php b/src/Eccube/Entity/MailHistory.php index 4e1670950e5..95fbecfaa1a 100644 --- a/src/Eccube/Entity/MailHistory.php +++ b/src/Eccube/Entity/MailHistory.php @@ -40,37 +40,37 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var \DateTime */ - private $send_date; + protected $send_date; /** * @var string */ - private $subject; + protected $subject; /** * @var string */ - private $mail_body; + protected $mail_body; /** * @var \Eccube\Entity\Order */ - private $Order; + protected $Order; /** * @var \Eccube\Entity\MailTemplate */ - private $MailTemplate; + protected $MailTemplate; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** * Get id diff --git a/src/Eccube/Entity/MailTemplate.php b/src/Eccube/Entity/MailTemplate.php index e2c0a7f61ad..b25f774d839 100644 --- a/src/Eccube/Entity/MailTemplate.php +++ b/src/Eccube/Entity/MailTemplate.php @@ -42,52 +42,52 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var string */ - private $file_name; + protected $file_name; /** * @var string */ - private $subject; + protected $subject; /** * @var string */ - private $header; + protected $header; /** * @var string */ - private $footer; + protected $footer; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** diff --git a/src/Eccube/Entity/Master/Authority.php b/src/Eccube/Entity/Master/Authority.php index c8ab2aafd8f..23fe2f78b59 100644 --- a/src/Eccube/Entity/Master/Authority.php +++ b/src/Eccube/Entity/Master/Authority.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/Country.php b/src/Eccube/Entity/Master/Country.php index e17800a36a5..eb793d4b10f 100644 --- a/src/Eccube/Entity/Master/Country.php +++ b/src/Eccube/Entity/Master/Country.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/CsvType.php b/src/Eccube/Entity/Master/CsvType.php index 6f19c478d05..1f10bdb227d 100644 --- a/src/Eccube/Entity/Master/CsvType.php +++ b/src/Eccube/Entity/Master/CsvType.php @@ -37,17 +37,17 @@ class CsvType extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** diff --git a/src/Eccube/Entity/Master/CustomerOrderStatus.php b/src/Eccube/Entity/Master/CustomerOrderStatus.php index 26ac1f6af0f..3f9b103602d 100644 --- a/src/Eccube/Entity/Master/CustomerOrderStatus.php +++ b/src/Eccube/Entity/Master/CustomerOrderStatus.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/CustomerStatus.php b/src/Eccube/Entity/Master/CustomerStatus.php index 62d4f114420..0673918efc7 100644 --- a/src/Eccube/Entity/Master/CustomerStatus.php +++ b/src/Eccube/Entity/Master/CustomerStatus.php @@ -50,17 +50,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/Db.php b/src/Eccube/Entity/Master/Db.php index 4a2533b5fc4..31a3045f967 100644 --- a/src/Eccube/Entity/Master/Db.php +++ b/src/Eccube/Entity/Master/Db.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/DeviceType.php b/src/Eccube/Entity/Master/DeviceType.php index 16ff1f301ca..dbed464542a 100644 --- a/src/Eccube/Entity/Master/DeviceType.php +++ b/src/Eccube/Entity/Master/DeviceType.php @@ -45,17 +45,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/Disp.php b/src/Eccube/Entity/Master/Disp.php index 09b8dc41d45..8ed0affd09d 100644 --- a/src/Eccube/Entity/Master/Disp.php +++ b/src/Eccube/Entity/Master/Disp.php @@ -47,17 +47,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/Job.php b/src/Eccube/Entity/Master/Job.php index ae50bf52d13..7f99b5acf49 100644 --- a/src/Eccube/Entity/Master/Job.php +++ b/src/Eccube/Entity/Master/Job.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/OrderStatus.php b/src/Eccube/Entity/Master/OrderStatus.php index 96560fa5511..8a7d1f99b8c 100644 --- a/src/Eccube/Entity/Master/OrderStatus.php +++ b/src/Eccube/Entity/Master/OrderStatus.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/OrderStatusColor.php b/src/Eccube/Entity/Master/OrderStatusColor.php index 63705d5e7eb..7049264f264 100644 --- a/src/Eccube/Entity/Master/OrderStatusColor.php +++ b/src/Eccube/Entity/Master/OrderStatusColor.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/PageMax.php b/src/Eccube/Entity/Master/PageMax.php index 8794a7a7d14..77ee80c6ec6 100644 --- a/src/Eccube/Entity/Master/PageMax.php +++ b/src/Eccube/Entity/Master/PageMax.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/Pref.php b/src/Eccube/Entity/Master/Pref.php index 2453f1b7822..84bda7d8f68 100644 --- a/src/Eccube/Entity/Master/Pref.php +++ b/src/Eccube/Entity/Master/Pref.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/ProductListMax.php b/src/Eccube/Entity/Master/ProductListMax.php index e8e36694018..6f3d93a8053 100644 --- a/src/Eccube/Entity/Master/ProductListMax.php +++ b/src/Eccube/Entity/Master/ProductListMax.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/ProductListOrderBy.php b/src/Eccube/Entity/Master/ProductListOrderBy.php index e14ddb97af3..c5d43948cab 100644 --- a/src/Eccube/Entity/Master/ProductListOrderBy.php +++ b/src/Eccube/Entity/Master/ProductListOrderBy.php @@ -39,17 +39,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/ProductType.php b/src/Eccube/Entity/Master/ProductType.php index 5edda4fb5de..f50a0845dc5 100644 --- a/src/Eccube/Entity/Master/ProductType.php +++ b/src/Eccube/Entity/Master/ProductType.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/Sex.php b/src/Eccube/Entity/Master/Sex.php index 7e614813ee5..569ee095926 100644 --- a/src/Eccube/Entity/Master/Sex.php +++ b/src/Eccube/Entity/Master/Sex.php @@ -40,17 +40,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/Tag.php b/src/Eccube/Entity/Master/Tag.php index 4ebef6dac5f..df16de6aba0 100644 --- a/src/Eccube/Entity/Master/Tag.php +++ b/src/Eccube/Entity/Master/Tag.php @@ -20,22 +20,22 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * @var \Doctrine\Common\Collections\Collection */ - private $ProductTag; + protected $ProductTag; /** * Constructor diff --git a/src/Eccube/Entity/Master/Taxrule.php b/src/Eccube/Entity/Master/Taxrule.php index 3a978820973..cba8d6dec87 100644 --- a/src/Eccube/Entity/Master/Taxrule.php +++ b/src/Eccube/Entity/Master/Taxrule.php @@ -56,17 +56,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/Work.php b/src/Eccube/Entity/Master/Work.php index e54835b39e2..9c2bcd9a449 100644 --- a/src/Eccube/Entity/Master/Work.php +++ b/src/Eccube/Entity/Master/Work.php @@ -45,17 +45,17 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var integer */ - private $rank; + protected $rank; /** * Get id diff --git a/src/Eccube/Entity/Master/Zip.php b/src/Eccube/Entity/Master/Zip.php index 96bb7c22698..b22e4222181 100644 --- a/src/Eccube/Entity/Master/Zip.php +++ b/src/Eccube/Entity/Master/Zip.php @@ -40,27 +40,27 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $zipcode; + protected $zipcode; /** * @var string */ - private $state; + protected $state; /** * @var string */ - private $city; + protected $city; /** * @var string */ - private $town; + protected $town; /** * Get id diff --git a/src/Eccube/Entity/Member.php b/src/Eccube/Entity/Member.php index 5c56d862edb..7b91de4cbd6 100644 --- a/src/Eccube/Entity/Member.php +++ b/src/Eccube/Entity/Member.php @@ -75,72 +75,72 @@ public function eraseCredentials() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var string */ - private $department; + protected $department; /** * @var string */ - private $login_id; + protected $login_id; /** * @var string */ - private $password; + protected $password; /** * @var string */ - private $salt; + protected $salt; /** * @var \Eccube\Entity\Master\Authority */ - private $Authority; + protected $Authority; /** * @var integer */ - private $rank; + protected $rank; /** * @var \Eccube\Entity\Master\Work */ - private $Work; + protected $Work; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var \DateTime */ - private $login_date; + protected $login_date; /** * Get id diff --git a/src/Eccube/Entity/News.php b/src/Eccube/Entity/News.php index edc1b755d09..080bf2b58e3 100644 --- a/src/Eccube/Entity/News.php +++ b/src/Eccube/Entity/News.php @@ -40,62 +40,62 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var \DateTime */ - private $date; + protected $date; /** * @var integer */ - private $rank; + protected $rank; /** * @var string */ - private $title; + protected $title; /** * @var string */ - private $comment; + protected $comment; /** * @var string */ - private $url; + protected $url; /** * @var integer */ - private $select; + protected $select; /** * @var integer */ - private $link_method; + protected $link_method; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** * Get id diff --git a/src/Eccube/Entity/Order.php b/src/Eccube/Entity/Order.php index af22174b80b..7c7aba0d23e 100644 --- a/src/Eccube/Entity/Order.php +++ b/src/Eccube/Entity/Order.php @@ -153,247 +153,247 @@ public function getTotalPrice() { /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $pre_order_id; + protected $pre_order_id; /** * @var string */ - private $message; + protected $message; /** * @var string */ - private $name01; + protected $name01; /** * @var string */ - private $name02; + protected $name02; /** * @var string */ - private $kana01; + protected $kana01; /** * @var string */ - private $kana02; + protected $kana02; /** * @var string */ - private $company_name; + protected $company_name; /** * @var string */ - private $email; + protected $email; /** * @var string */ - private $tel01; + protected $tel01; /** * @var string */ - private $tel02; + protected $tel02; /** * @var string */ - private $tel03; + protected $tel03; /** * @var string */ - private $fax01; + protected $fax01; /** * @var string */ - private $fax02; + protected $fax02; /** * @var string */ - private $fax03; + protected $fax03; /** * @var string */ - private $zip01; + protected $zip01; /** * @var string */ - private $zip02; + protected $zip02; /** * @var string */ - private $zipcode; + protected $zipcode; /** * @var string */ - private $addr01; + protected $addr01; /** * @var string */ - private $addr02; + protected $addr02; /** * @var \DateTime */ - private $birth; + protected $birth; /** * @var string */ - private $subtotal; + protected $subtotal; /** * @var string */ - private $discount; + protected $discount; /** * @var string */ - private $delivery_fee_total; + protected $delivery_fee_total; /** * @var string */ - private $charge; + protected $charge; /** * @var string */ - private $tax; + protected $tax; /** * @var string */ - private $total; + protected $total; /** * @var string */ - private $payment_total; + protected $payment_total; /** * @var string */ - private $payment_method; + protected $payment_method; /** * @var string */ - private $note; + protected $note; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var \DateTime */ - private $order_date; + protected $order_date; /** * @var \DateTime */ - private $commit_date; + protected $commit_date; /** * @var \DateTime */ - private $payment_date; + protected $payment_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \Doctrine\Common\Collections\Collection */ - private $OrderDetails; + protected $OrderDetails; /** * @var \Doctrine\Common\Collections\Collection */ - private $Shippings; + protected $Shippings; /** * @var \Doctrine\Common\Collections\Collection */ - private $MailHistories; + protected $MailHistories; /** * @var \Eccube\Entity\Customer */ - private $Customer; + protected $Customer; /** * @var \Eccube\Entity\Master\Country */ - private $Country; + protected $Country; /** * @var \Eccube\Entity\Master\Pref */ - private $Pref; + protected $Pref; /** * @var \Eccube\Entity\Master\Sex */ - private $Sex; + protected $Sex; /** * @var \Eccube\Entity\Master\Job */ - private $Job; + protected $Job; /** * @var \Eccube\Entity\Payment */ - private $Payment; + protected $Payment; /** * @var \Eccube\Entity\Master\DeviceType */ - private $DeviceType; + protected $DeviceType; /** * @var \Eccube\Entity\Master\CustomerOrderStatus */ - private $CustomerOrderStatus; + protected $CustomerOrderStatus; /** * @var \Eccube\Entity\Master\OrderStatus */ - private $OrderStatus; + protected $OrderStatus; /** * @var \Eccube\Entity\Master\OrderStatusColor */ - private $OrderStatusColor; + protected $OrderStatusColor; /** * Constructor diff --git a/src/Eccube/Entity/OrderDetail.php b/src/Eccube/Entity/OrderDetail.php index b119a2efdd5..95915f8f06b 100644 --- a/src/Eccube/Entity/OrderDetail.php +++ b/src/Eccube/Entity/OrderDetail.php @@ -31,7 +31,7 @@ */ class OrderDetail extends \Eccube\Entity\AbstractEntity { - private $price_inc_tax = null; + protected $price_inc_tax = null; public function isPriceChange() { @@ -124,62 +124,62 @@ public function getTotalPrice() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $product_name; + protected $product_name; /** * @var string */ - private $product_code; + protected $product_code; /** * @var string */ - private $class_category_name1; + protected $class_category_name1; /** * @var string */ - private $class_category_name2; + protected $class_category_name2; /** * @var string */ - private $price; + protected $price; /** * @var string */ - private $quantity; + protected $quantity; /** * @var string */ - private $tax_rate; + protected $tax_rate; /** * @var integer */ - private $tax_rule; + protected $tax_rule; /** * @var \Eccube\Entity\Order */ - private $Order; + protected $Order; /** * @var \Eccube\Entity\Product */ - private $Product; + protected $Product; /** * @var \Eccube\Entity\ProductClass */ - private $ProductClass; + protected $ProductClass; /** * Get id @@ -452,12 +452,12 @@ public function getProductClass() /** * @var string */ - private $class_name1; + protected $class_name1; /** * @var string */ - private $class_name2; + protected $class_name2; /** diff --git a/src/Eccube/Entity/PageLayout.php b/src/Eccube/Entity/PageLayout.php index 206148e107d..fd139d2d631 100644 --- a/src/Eccube/Entity/PageLayout.php +++ b/src/Eccube/Entity/PageLayout.php @@ -193,72 +193,72 @@ public function getFooter() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var string */ - private $url; + protected $url; /** * @var string */ - private $file_name; + protected $file_name; /** * @var integer */ - private $edit_flg; + protected $edit_flg; /** * @var string */ - private $author; + protected $author; /** * @var string */ - private $description; + protected $description; /** * @var string */ - private $keyword; + protected $keyword; /** * @var string */ - private $update_url; + protected $update_url; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var string */ - private $meta_robots; + protected $meta_robots; /** * @var \Doctrine\Common\Collections\Collection */ - private $BlockPositions; + protected $BlockPositions; /** * @var \Eccube\Entity\Master\DeviceType */ - private $DeviceType; + protected $DeviceType; /** * Constructor diff --git a/src/Eccube/Entity/Payment.php b/src/Eccube/Entity/Payment.php index 9079416348d..7493a7c9b65 100644 --- a/src/Eccube/Entity/Payment.php +++ b/src/Eccube/Entity/Payment.php @@ -40,72 +40,72 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $method; + protected $method; /** * @var string */ - private $charge; + protected $charge; /** * @var string */ - private $rule_min; + protected $rule_min; /** * @var string */ - private $rule_max; + protected $rule_max; /** * @var integer */ - private $rank; + protected $rank; /** * @var integer */ - private $fix_flg; + protected $fix_flg; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var string */ - private $payment_image; + protected $payment_image; /** * @var integer */ - private $charge_flg; + protected $charge_flg; /** * @var \Doctrine\Common\Collections\Collection */ - private $PaymentOptions; + protected $PaymentOptions; /** * Constructor diff --git a/src/Eccube/Entity/PaymentOption.php b/src/Eccube/Entity/PaymentOption.php index b0e12b30226..7702eb4a14e 100644 --- a/src/Eccube/Entity/PaymentOption.php +++ b/src/Eccube/Entity/PaymentOption.php @@ -33,27 +33,27 @@ class PaymentOption extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $delivery_id; + protected $delivery_id; /** * @var integer */ - private $payment_id; + protected $payment_id; /** * @var integer */ - private $rank; + protected $rank; /** * @var \Eccube\Entity\Delivery */ - private $Delivery; + protected $Delivery; /** * @var \Eccube\Entity\Payment */ - private $Payment; + protected $Payment; /** * Set delivery_id diff --git a/src/Eccube/Entity/Plugin.php b/src/Eccube/Entity/Plugin.php index a9d90c7003e..04cd375a101 100644 --- a/src/Eccube/Entity/Plugin.php +++ b/src/Eccube/Entity/Plugin.php @@ -34,81 +34,81 @@ class Plugin extends AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var string */ - private $code; + protected $code; /** * @var string */ - private $class_name; + protected $class_name; /** * @var integer */ - private $enable; + protected $enable; /** * @var string */ - private $version; + protected $version; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var integer */ - private $source; + protected $source; - private $update_date; + protected $update_date; // local property /** * @var string */ - private $update_status; + protected $update_status; /** * @var string */ - private $new_version; + protected $new_version; /** * @var string */ - private $last_update_date; + protected $last_update_date; /** * @var string */ - private $product_url; + protected $product_url; /** * @var array */ - private $eccube_version; + protected $eccube_version; /** * @var \Doctrine\Common\Collections\Collection */ - private $PluginEventHandlers; + protected $PluginEventHandlers; public function __construct() diff --git a/src/Eccube/Entity/PluginEventHandler.php b/src/Eccube/Entity/PluginEventHandler.php index 474cb53e502..5100c5ce8d3 100644 --- a/src/Eccube/Entity/PluginEventHandler.php +++ b/src/Eccube/Entity/PluginEventHandler.php @@ -51,46 +51,46 @@ class PluginEventHandler extends AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $event; + protected $event; /** * @var int */ - private $priority; + protected $priority; /** * @var int */ - private $plugin_id; + protected $plugin_id; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var string */ - private $handler; + protected $handler; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; - private $Plugin; + protected $Plugin; - private $handler_type; + protected $handler_type; /** * Get id diff --git a/src/Eccube/Entity/Product.php b/src/Eccube/Entity/Product.php index c74bb323dbe..5b2f27d8aeb 100644 --- a/src/Eccube/Entity/Product.php +++ b/src/Eccube/Entity/Product.php @@ -31,19 +31,19 @@ */ class Product extends \Eccube\Entity\AbstractEntity { - private $_calc = false; - private $stockFinds = array(); - private $stocks = array(); - private $stockUnlimiteds = array(); - private $price01 = array(); - private $price02 = array(); - private $price01IncTaxs = array(); - private $price02IncTaxs = array(); - private $codes = array(); - private $classCategories1 = array(); - private $classCategories2 = array(); - private $className1; - private $className2; + protected $_calc = false; + protected $stockFinds = array(); + protected $stocks = array(); + protected $stockUnlimiteds = array(); + protected $price01 = array(); + protected $price02 = array(); + protected $price01IncTaxs = array(); + protected $price02IncTaxs = array(); + protected $codes = array(); + protected $classCategories1 = array(); + protected $classCategories2 = array(); + protected $className1; + protected $className2; /** * @return string @@ -425,77 +425,77 @@ public function getMainListImage() { /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name; + protected $name; /** * @var string */ - private $note; + protected $note; /** * @var string */ - private $description_list; + protected $description_list; /** * @var string */ - private $description_detail; + protected $description_detail; /** * @var string */ - private $search_word; + protected $search_word; /** * @var string */ - private $free_area; + protected $free_area; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var \Doctrine\Common\Collections\Collection */ - private $ProductCategories; + protected $ProductCategories; /** * @var \Doctrine\Common\Collections\Collection */ - private $ProductClasses; + protected $ProductClasses; /** * @var \Doctrine\Common\Collections\Collection */ - private $CustomerFavoriteProducts; + protected $CustomerFavoriteProducts; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** * @var \Eccube\Entity\Master\Disp */ - private $Status; + protected $Status; /** * Constructor @@ -932,12 +932,12 @@ public function getStatus() /** * @var \Doctrine\Common\Collections\Collection */ - private $ProductImage; + protected $ProductImage; /** * @var \Doctrine\Common\Collections\Collection */ - private $ProductTag; + protected $ProductTag; /** diff --git a/src/Eccube/Entity/ProductCategory.php b/src/Eccube/Entity/ProductCategory.php index 11a747308e4..8e5b8d0df61 100644 --- a/src/Eccube/Entity/ProductCategory.php +++ b/src/Eccube/Entity/ProductCategory.php @@ -32,27 +32,27 @@ class ProductCategory extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $product_id; + protected $product_id; /** * @var integer */ - private $category_id; + protected $category_id; /** * @var integer */ - private $rank; + protected $rank; /** * @var \Eccube\Entity\Product */ - private $Product; + protected $Product; /** * @var \Eccube\Entity\Category */ - private $Category; + protected $Category; /** * Set product_id diff --git a/src/Eccube/Entity/ProductClass.php b/src/Eccube/Entity/ProductClass.php index c413f0b4b32..f17325dbcd0 100644 --- a/src/Eccube/Entity/ProductClass.php +++ b/src/Eccube/Entity/ProductClass.php @@ -29,10 +29,10 @@ */ class ProductClass extends \Eccube\Entity\AbstractEntity { - private $price01_inc_tax = null; - private $price02_inc_tax = null; - private $add = false; - private $tax_rate = false; + protected $price01_inc_tax = null; + protected $price02_inc_tax = null; + protected $add = false; + protected $tax_rate = false; /** * Is Enable @@ -156,87 +156,87 @@ public function getTaxRate() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $code; + protected $code; /** * @var string */ - private $stock; + protected $stock; /** * @var integer */ - private $stock_unlimited; + protected $stock_unlimited; /** * @var string */ - private $sale_limit; + protected $sale_limit; /** * @var string */ - private $price01; + protected $price01; /** * @var string */ - private $price02; + protected $price02; /** * @var string */ - private $delivery_fee; + protected $delivery_fee; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \Eccube\Entity\Product */ - private $Product; + protected $Product; /** * @var \Eccube\Entity\Master\ProductType */ - private $ProductType; + protected $ProductType; /** * @var \Eccube\Entity\ClassCategory */ - private $ClassCategory1; + protected $ClassCategory1; /** * @var \Eccube\Entity\ClassCategory */ - private $ClassCategory2; + protected $ClassCategory2; /** * @var \Eccube\Entity\DeliveryDate */ - private $DeliveryDate; + protected $DeliveryDate; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; public function __clone() { @@ -644,7 +644,7 @@ public function getCreator() /** * @var \Eccube\Entity\ProductStock */ - private $ProductStock; + protected $ProductStock; /** @@ -672,7 +672,7 @@ public function getProductStock() /** * @var \Eccube\Entity\TaxRule */ - private $TaxRule; + protected $TaxRule; /** diff --git a/src/Eccube/Entity/ProductImage.php b/src/Eccube/Entity/ProductImage.php index f6706db8357..0083f76b550 100644 --- a/src/Eccube/Entity/ProductImage.php +++ b/src/Eccube/Entity/ProductImage.php @@ -20,32 +20,32 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $file_name; + protected $file_name; /** * @var integer */ - private $rank; + protected $rank; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \Eccube\Entity\Product */ - private $Product; + protected $Product; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** diff --git a/src/Eccube/Entity/ProductStock.php b/src/Eccube/Entity/ProductStock.php index 8773a4e0162..adbe6061bd7 100644 --- a/src/Eccube/Entity/ProductStock.php +++ b/src/Eccube/Entity/ProductStock.php @@ -12,32 +12,32 @@ class ProductStock extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var integer */ - private $product_class_id; + protected $product_class_id; /** * @var string */ - private $stock; + protected $stock; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; public function __clone() { @@ -171,7 +171,7 @@ public function getCreator() /** * @var \Eccube\Entity\ProductClass */ - private $ProductClass; + protected $ProductClass; /** diff --git a/src/Eccube/Entity/ProductTag.php b/src/Eccube/Entity/ProductTag.php index 43798b0632b..4590c35dfba 100644 --- a/src/Eccube/Entity/ProductTag.php +++ b/src/Eccube/Entity/ProductTag.php @@ -12,27 +12,27 @@ class ProductTag extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \Eccube\Entity\Product */ - private $Product; + protected $Product; /** * @var \Eccube\Entity\Master\Tag */ - private $Tag; + protected $Tag; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** diff --git a/src/Eccube/Entity/ShipmentItem.php b/src/Eccube/Entity/ShipmentItem.php index 936d57d4efb..8fdacbca668 100644 --- a/src/Eccube/Entity/ShipmentItem.php +++ b/src/Eccube/Entity/ShipmentItem.php @@ -31,7 +31,7 @@ */ class ShipmentItem extends \Eccube\Entity\AbstractEntity { - private $price_inc_tax = null; + protected $price_inc_tax = null; /** * Set price IncTax @@ -67,57 +67,57 @@ public function getTotalPrice() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $product_name; + protected $product_name; /** * @var string */ - private $product_code; + protected $product_code; /** * @var string */ - private $class_category_name1; + protected $class_category_name1; /** * @var string */ - private $class_category_name2; + protected $class_category_name2; /** * @var string */ - private $price; + protected $price; /** * @var string */ - private $quantity; + protected $quantity; /** * @var \Eccube\Entity\Order */ - private $Order; + protected $Order; /** * @var \Eccube\Entity\Product */ - private $Product; + protected $Product; /** * @var \Eccube\Entity\ProductClass */ - private $ProductClass; + protected $ProductClass; /** * @var \Eccube\Entity\Shipping */ - private $Shipping; + protected $Shipping; /** @@ -365,12 +365,12 @@ public function getShipping() /** * @var string */ - private $class_name1; + protected $class_name1; /** * @var string */ - private $class_name2; + protected $class_name2; /** diff --git a/src/Eccube/Entity/Shipping.php b/src/Eccube/Entity/Shipping.php index 1f3fdd1654a..7ea7800a5e6 100644 --- a/src/Eccube/Entity/Shipping.php +++ b/src/Eccube/Entity/Shipping.php @@ -34,167 +34,167 @@ class Shipping extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $name01; + protected $name01; /** * @var string */ - private $name02; + protected $name02; /** * @var string */ - private $kana01; + protected $kana01; /** * @var string */ - private $kana02; + protected $kana02; /** * @var string */ - private $company_name; + protected $company_name; /** * @var string */ - private $tel01; + protected $tel01; /** * @var string */ - private $tel02; + protected $tel02; /** * @var string */ - private $tel03; + protected $tel03; /** * @var string */ - private $fax01; + protected $fax01; /** * @var string */ - private $fax02; + protected $fax02; /** * @var string */ - private $fax03; + protected $fax03; /** * @var string */ - private $zip01; + protected $zip01; /** * @var string */ - private $zip02; + protected $zip02; /** * @var string */ - private $zipcode; + protected $zipcode; /** * @var string */ - private $addr01; + protected $addr01; /** * @var string */ - private $addr02; + protected $addr02; /** * @var string */ - private $shipping_delivery_name; + protected $shipping_delivery_name; /** * @var string */ - private $shipping_delivery_time; + protected $shipping_delivery_time; /** * @var \DateTime */ - private $shipping_delivery_date; + protected $shipping_delivery_date; /** * @var string */ - private $shipping_delivery_fee; + protected $shipping_delivery_fee; /** * @var \DateTime */ - private $shipping_commit_date; + protected $shipping_commit_date; /** * @var integer */ - private $rank; + protected $rank; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \Doctrine\Common\Collections\Collection */ - private $ShipmentItems; + protected $ShipmentItems; /** * @var \Eccube\Entity\Master\Country */ - private $Country; + protected $Country; /** * @var \Eccube\Entity\Master\Pref */ - private $Pref; + protected $Pref; /** * @var \Eccube\Entity\Order */ - private $Order; + protected $Order; /** * @var \Eccube\Entity\Delivery */ - private $Delivery; + protected $Delivery; /** * @var \Eccube\Entity\DeliveryTime */ - private $DeliveryTime; + protected $DeliveryTime; /** * @var \Eccube\Entity\DeliveryFee */ - private $DeliveryFee; + protected $DeliveryFee; /** * Constructor diff --git a/src/Eccube/Entity/TaxRule.php b/src/Eccube/Entity/TaxRule.php index b553d8a802d..f76c80a8cea 100644 --- a/src/Eccube/Entity/TaxRule.php +++ b/src/Eccube/Entity/TaxRule.php @@ -37,7 +37,7 @@ class TaxRule extends \Eccube\Entity\AbstractEntity /** * @var integer */ - private $rank; + protected $rank; /** * is default @@ -75,67 +75,67 @@ public function getRank() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $tax_rate; + protected $tax_rate; /** * @var string */ - private $tax_adjust; + protected $tax_adjust; /** * @var \DateTime */ - private $apply_date; + protected $apply_date; /** * @var integer */ - private $del_flg; + protected $del_flg; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var \Eccube\Entity\Member */ - private $Creator; + protected $Creator; /** * @var \Eccube\Entity\Master\Country */ - private $Country; + protected $Country; /** * @var \Eccube\Entity\Master\Pref */ - private $Pref; + protected $Pref; /** * @var \Eccube\Entity\Product */ - private $Product; + protected $Product; /** * @var \Eccube\Entity\ProductClass */ - private $ProductClass; + protected $ProductClass; /** * @var \Eccube\Entity\Master\Taxrule */ - private $CalcRule; + protected $CalcRule; /** diff --git a/src/Eccube/Entity/Template.php b/src/Eccube/Entity/Template.php index d7d4a3e0de7..ed38a831533 100644 --- a/src/Eccube/Entity/Template.php +++ b/src/Eccube/Entity/Template.php @@ -54,32 +54,32 @@ public function __toString() /** * @var integer */ - private $id; + protected $id; /** * @var string */ - private $code; + protected $code; /** * @var string */ - private $name; + protected $name; /** * @var \DateTime */ - private $create_date; + protected $create_date; /** * @var \DateTime */ - private $update_date; + protected $update_date; /** * @var \Eccube\Entity\Master\DeviceType */ - private $DeviceType; + protected $DeviceType; /** From a7fe3d737e2e4e3b959f5b32abbb970fd1954fe6 Mon Sep 17 00:00:00 2001 From: Hama Date: Thu, 6 Oct 2016 16:08:34 +0900 Subject: [PATCH 2/7] =?UTF-8?q?=E6=9C=AC=E4=BD=93=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E3=82=A8=E3=83=B3=E3=83=86=E3=82=A3=E3=83=86=E3=82=A3=E6=8B=A1?= =?UTF-8?q?=E5=BC=B5=E3=82=92=E8=A1=8C=E3=82=8F=E3=81=AA=E3=81=84=E3=82=88?= =?UTF-8?q?=E3=81=86=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ※ extended_entitiesを記述する場所を考えていなかったため --- src/Eccube/Application.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Eccube/Application.php b/src/Eccube/Application.php index fd07e4f953d..03a64d06887 100644 --- a/src/Eccube/Application.php +++ b/src/Eccube/Application.php @@ -421,6 +421,12 @@ public function initDoctrine() __DIR__.'/Resource/doctrine/master', ); $ormMappings = array(); + $ormMappings[] = array( + 'type' => 'yml', + 'namespace' => 'Eccube\Entity', + 'path' => $basePaths, + ); + $pluginMappings = array(); $allPaths = array(); @@ -451,16 +457,9 @@ public function initDoctrine() } } - $ormMappings[] = array( - 'type' => 'yml', - 'namespace' => 'Eccube\Entity', - 'path' => array_merge($basePaths, $allPaths), - ); - foreach ($pluginMappings as &$pluginMapping) { $pluginMapping['path'] = array_unique(array_merge($pluginMapping['path'], $allPaths, $basePaths)); } - $ormMappings = array_merge($ormMappings, $pluginMappings); $options = array( From 1fe2e7cf05936c7a76fd8f9e79e44520f4ad0dda Mon Sep 17 00:00:00 2001 From: Hama Date: Thu, 6 Oct 2016 16:38:47 +0900 Subject: [PATCH 3/7] =?UTF-8?q?Fatal=20Error=E3=81=8C=E7=99=BA=E7=94=9F?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Doctrine/ORM/Mapping/Driver/YamlDriver.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php index 55220c40429..cff9fb8caf0 100644 --- a/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -57,12 +57,22 @@ protected function loadMappingFile($file) */ public function addExtendedEntity($extendedEntity) { - if (!in_array($extendedEntity, $this->extendedEntities, true)) { + if (!in_array($extendedEntity, $this->getExtendedEntities(), true)) { $this->extendedEntities[] = $extendedEntity; } return $this; } + /** + * Getter for extendedEntities. + * + * @return array + */ + public function getExtendedEntities() + { + return $this->extendedEntities; + } + /** * {@inheritDoc} */ @@ -73,7 +83,7 @@ public function getAllClassNames() return array_filter( $classNames, function ($className) use ($driver) { - return !in_array($className, $driver->extendedEntities, true); + return !in_array($className, $driver->getExtendedEntities(), true); } ); } @@ -92,7 +102,7 @@ function ($className) use ($driver) { public function isTransient($className) { $isTransient = parent::isTransient($className); - if (!$isTransient && in_array($className, $this->extendedEntities, true)) { + if (!$isTransient && in_array($className, $this->getExtendedEntities(), true)) { $isTransient = true; } return $isTransient; From d953bd18adae86f709b57a133d2be58423e4e9a3 Mon Sep 17 00:00:00 2001 From: Hama Date: Thu, 6 Oct 2016 17:10:05 +0900 Subject: [PATCH 4/7] =?UTF-8?q?Revert=20"=E6=9C=AC=E4=BD=93=E3=81=A7?= =?UTF-8?q?=E3=81=AF=E3=82=A8=E3=83=B3=E3=83=86=E3=82=A3=E3=83=86=E3=82=A3?= =?UTF-8?q?=E6=8B=A1=E5=BC=B5=E3=82=92=E8=A1=8C=E3=82=8F=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E5=A4=89=E6=9B=B4"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ※ extended_entities.ymlで拡張するエンティティを列挙する --- src/Eccube/Application.php | 22 ++++++++++++++----- .../config/extended_entities.yml.dist | 1 + 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 src/Eccube/Resource/config/extended_entities.yml.dist diff --git a/src/Eccube/Application.php b/src/Eccube/Application.php index 03a64d06887..71e44991d2f 100644 --- a/src/Eccube/Application.php +++ b/src/Eccube/Application.php @@ -94,6 +94,7 @@ public function initConfig() ->parseConfig('nav', $configAll, true) ->parseConfig('doctrine_cache', $configAll) ->parseConfig('http_cache', $configAll) + ->parseConfig('extended_entities', $configAll) ->parseConfig('session_handler', $configAll); return $configAll; @@ -421,12 +422,6 @@ public function initDoctrine() __DIR__.'/Resource/doctrine/master', ); $ormMappings = array(); - $ormMappings[] = array( - 'type' => 'yml', - 'namespace' => 'Eccube\Entity', - 'path' => $basePaths, - ); - $pluginMappings = array(); $allPaths = array(); @@ -457,9 +452,16 @@ public function initDoctrine() } } + $ormMappings[] = array( + 'type' => 'yml', + 'namespace' => 'Eccube\Entity', + 'path' => array_merge($basePaths, $allPaths), + ); + foreach ($pluginMappings as &$pluginMapping) { $pluginMapping['path'] = array_unique(array_merge($pluginMapping['path'], $allPaths, $basePaths)); } + $ormMappings = array_merge($ormMappings, $pluginMappings); $options = array( @@ -948,6 +950,14 @@ public function loadPlugin() } } } + + $driverChain = $this['orm.em']->getConfiguration()->getMetadataDriverImpl(); + $drivers = $driverChain->getDrivers(); + foreach ($drivers as $namespace => $driver) { + if ($driver instanceof \Eccube\Doctrine\ORM\Mapping\Driver\YamlDriver) { + $driver->addExtendedEntity('Eccube\Entity\OrigProduct'); + } + } } /** diff --git a/src/Eccube/Resource/config/extended_entities.yml.dist b/src/Eccube/Resource/config/extended_entities.yml.dist new file mode 100644 index 00000000000..28af16d1c0c --- /dev/null +++ b/src/Eccube/Resource/config/extended_entities.yml.dist @@ -0,0 +1 @@ +extended_entities: [] From ec9de517d617fe4b5e5622340cae0c1e0e742bc2 Mon Sep 17 00:00:00 2001 From: Hama Date: Fri, 7 Oct 2016 17:29:58 +0900 Subject: [PATCH 5/7] =?UTF-8?q?phpdoc=E7=AD=89=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ORM/Mapping/Driver/YamlDriver.php | 47 +++++-------------- 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php index cff9fb8caf0..387f2ffde40 100644 --- a/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -49,10 +49,9 @@ protected function loadMappingFile($file) protected $extendedEntities = array(); /** - * Setter for extendedEntities. + * 継承元のエンティティを追加する * * @param string $extendedEntity - * * @return $this */ public function addExtendedEntity($extendedEntity) @@ -64,7 +63,7 @@ public function addExtendedEntity($extendedEntity) } /** - * Getter for extendedEntities. + * 継承元エンティティの配列を取得する * * @return array */ @@ -74,49 +73,28 @@ public function getExtendedEntities() } /** - * {@inheritDoc} + * {@inheritdoc} */ public function getAllClassNames() { $driver = $this; $classNames = parent::getAllClassNames(); - return array_filter( - $classNames, - function ($className) use ($driver) { - return !in_array($className, $driver->getExtendedEntities(), true); - } - ); + $filter = function ($className) use ($driver) { + return !in_array($className, $driver->getExtendedEntities(), true); + }; + return array_filter($classNames, $filter); } /** - * Returns whether the class with the specified name is transient. Only non-transient - * classes, that is entities and mapped superclasses, should have their metadata loaded. - * - * A class is non-transient if it is annotated with an annotation - * from the {@see AnnotationDriver::entityAnnotationClasses}. - * - * @param string $className - * - * @return boolean + * {@inheritdoc} */ public function isTransient($className) { - $isTransient = parent::isTransient($className); - if (!$isTransient && in_array($className, $this->getExtendedEntities(), true)) { - $isTransient = true; - } - return $isTransient; + return parent::isTransient($className) || in_array($className, $this->getExtendedEntities(), true); } /** - * Gets the element of schema meta data for the class from the mapping file. - * This will lazily load the mapping file if it is not loaded yet. - * - * Overridden in order to merger mapping with parent class if 'extended_entity' is provided. - * - * @param string $className - * - * @return array The element of schema meta data. + * {@inheritdoc} */ public function getElement($className) { @@ -130,18 +108,15 @@ public function getElement($className) } /** - * Merges mappings recursively and overrides duplicated values with second mappings values. - * * @param array $mapping1 * @param array $mapping2 - * * @return array */ protected function mergeMappings(array &$mapping1, array &$mapping2) { $merged = $mapping1; foreach ($mapping2 as $key => &$value) { - if (is_array ($value) && isset($merged[$key]) && is_array($merged[$key])) { + if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { $merged[$key] = $this->mergeMappings($merged[$key], $value); } else { $merged[$key] = $value; From 4613b300f2f78c0262efc460eacd6fb12c736707 Mon Sep 17 00:00:00 2001 From: Hama Date: Fri, 7 Oct 2016 18:13:43 +0900 Subject: [PATCH 6/7] =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=82=BB=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E8=A1=A8=E7=A4=BA=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php index 387f2ffde40..5d4012442f4 100644 --- a/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/src/Eccube/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -43,6 +43,14 @@ protected function loadMappingFile($file) return Yaml::parse(file_get_contents($file)); } + /* + * 以下、エンティティ拡張機構 + * + * Copyright (c) by Paulius Jarmalavicius + * Released under the MIT license + * https://opensource.org/licenses/mit-license.php + */ + /** * @var array */ From e74b2b27098d41ed13c105ea23960e8f0161d6d2 Mon Sep 17 00:00:00 2001 From: Hama Date: Tue, 27 Dec 2016 15:09:22 +0900 Subject: [PATCH 7/7] =?UTF-8?q?=E3=83=87=E3=83=90=E3=83=83=E3=82=B0?= =?UTF-8?q?=E7=94=A8=E3=81=AE=E3=82=B3=E3=83=BC=E3=83=89=E3=81=8C=E5=85=A5?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Eccube/Application.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Eccube/Application.php b/src/Eccube/Application.php index 71e44991d2f..c4e52cf3a09 100644 --- a/src/Eccube/Application.php +++ b/src/Eccube/Application.php @@ -950,14 +950,6 @@ public function loadPlugin() } } } - - $driverChain = $this['orm.em']->getConfiguration()->getMetadataDriverImpl(); - $drivers = $driverChain->getDrivers(); - foreach ($drivers as $namespace => $driver) { - if ($driver instanceof \Eccube\Doctrine\ORM\Mapping\Driver\YamlDriver) { - $driver->addExtendedEntity('Eccube\Entity\OrigProduct'); - } - } } /**