21
21
* Product
22
22
*
23
23
* @ORM\Table(name="dtb_product")
24
+ *
24
25
* @ORM\InheritanceType("SINGLE_TABLE")
26
+ *
25
27
* @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
28
+ *
26
29
* @ORM\HasLifecycleCallbacks()
30
+ *
27
31
* @ORM\Entity(repositoryClass="Eccube\Repository\ProductRepository")
28
32
*/
29
- class Product extends \ Eccube \ Entity \ AbstractEntity
33
+ class Product extends AbstractEntity
30
34
{
31
35
private $ _calc = false ;
32
36
private $ stockFinds = [];
@@ -55,7 +59,7 @@ public function _calc()
55
59
if (!$ this ->_calc ) {
56
60
$ i = 0 ;
57
61
foreach ($ this ->getProductClasses () as $ ProductClass ) {
58
- /** @var \Eccube\Entity\ ProductClass $ProductClass */
62
+ /** @var ProductClass $ProductClass */
59
63
// stock_find
60
64
if ($ ProductClass ->isVisible () == false ) {
61
65
continue ;
@@ -128,7 +132,7 @@ public function _calc()
128
132
*/
129
133
public function isEnable ()
130
134
{
131
- return $ this ->getStatus ()->getId () === \ Eccube \ Entity \ Master \ProductStatus::DISPLAY_SHOW ? true : false ;
135
+ return $ this ->getStatus ()->getId () === Master \ProductStatus::DISPLAY_SHOW ? true : false ;
132
136
}
133
137
134
138
/**
@@ -447,7 +451,9 @@ public function hasProductClass()
447
451
* @var integer
448
452
*
449
453
* @ORM\Column(name="id", type="integer", options={"unsigned":true})
454
+ *
450
455
* @ORM\Id
456
+ *
451
457
* @ORM\GeneratedValue(strategy="IDENTITY")
452
458
*/
453
459
private $ id ;
@@ -526,6 +532,7 @@ public function hasProductClass()
526
532
* @var \Doctrine\Common\Collections\Collection
527
533
*
528
534
* @ORM\OneToMany(targetEntity="Eccube\Entity\ProductImage", mappedBy="Product", cascade={"remove"})
535
+ *
529
536
* @ORM\OrderBy({
530
537
* "sort_no"="ASC"
531
538
* })
@@ -547,20 +554,24 @@ public function hasProductClass()
547
554
private $ CustomerFavoriteProducts ;
548
555
549
556
/**
550
- * @var \Eccube\Entity\ Member
557
+ * @var Member
551
558
*
552
559
* @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
560
+ *
553
561
* @ORM\JoinColumns({
562
+ *
554
563
* @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
555
564
* })
556
565
*/
557
566
private $ Creator ;
558
567
559
568
/**
560
- * @var \Eccube\Entity\ Master\ProductStatus
569
+ * @var Master\ProductStatus
561
570
*
562
571
* @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\ProductStatus")
572
+ *
563
573
* @ORM\JoinColumns({
574
+ *
564
575
* @ORM\JoinColumn(name="product_status_id", referencedColumnName="id")
565
576
* })
566
577
*/
@@ -571,11 +582,11 @@ public function hasProductClass()
571
582
*/
572
583
public function __construct ()
573
584
{
574
- $ this ->ProductCategories = new \ Doctrine \ Common \ Collections \ ArrayCollection ();
575
- $ this ->ProductClasses = new \ Doctrine \ Common \ Collections \ ArrayCollection ();
576
- $ this ->ProductImage = new \ Doctrine \ Common \ Collections \ ArrayCollection ();
577
- $ this ->ProductTag = new \ Doctrine \ Common \ Collections \ ArrayCollection ();
578
- $ this ->CustomerFavoriteProducts = new \ Doctrine \ Common \ Collections \ ArrayCollection ();
585
+ $ this ->ProductCategories = new ArrayCollection ();
586
+ $ this ->ProductClasses = new ArrayCollection ();
587
+ $ this ->ProductImage = new ArrayCollection ();
588
+ $ this ->ProductTag = new ArrayCollection ();
589
+ $ this ->CustomerFavoriteProducts = new ArrayCollection ();
579
590
}
580
591
581
592
public function __clone ()
@@ -828,7 +839,7 @@ public function getUpdateDate()
828
839
/**
829
840
* Add productCategory.
830
841
*
831
- * @param \Eccube\Entity\ ProductCategory $productCategory
842
+ * @param ProductCategory $productCategory
832
843
*
833
844
* @return Product
834
845
*/
@@ -842,7 +853,7 @@ public function addProductCategory(ProductCategory $productCategory)
842
853
/**
843
854
* Remove productCategory.
844
855
*
845
- * @param \Eccube\Entity\ ProductCategory $productCategory
856
+ * @param ProductCategory $productCategory
846
857
*
847
858
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
848
859
*/
@@ -864,7 +875,7 @@ public function getProductCategories()
864
875
/**
865
876
* Add productClass.
866
877
*
867
- * @param \Eccube\Entity\ ProductClass $productClass
878
+ * @param ProductClass $productClass
868
879
*
869
880
* @return Product
870
881
*/
@@ -878,7 +889,7 @@ public function addProductClass(ProductClass $productClass)
878
889
/**
879
890
* Remove productClass.
880
891
*
881
- * @param \Eccube\Entity\ ProductClass $productClass
892
+ * @param ProductClass $productClass
882
893
*
883
894
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
884
895
*/
@@ -900,7 +911,7 @@ public function getProductClasses()
900
911
/**
901
912
* Add productImage.
902
913
*
903
- * @param \Eccube\Entity\ ProductImage $productImage
914
+ * @param ProductImage $productImage
904
915
*
905
916
* @return Product
906
917
*/
@@ -914,7 +925,7 @@ public function addProductImage(ProductImage $productImage)
914
925
/**
915
926
* Remove productImage.
916
927
*
917
- * @param \Eccube\Entity\ ProductImage $productImage
928
+ * @param ProductImage $productImage
918
929
*
919
930
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
920
931
*/
@@ -936,7 +947,7 @@ public function getProductImage()
936
947
/**
937
948
* Add productTag.
938
949
*
939
- * @param \Eccube\Entity\ ProductTag $productTag
950
+ * @param ProductTag $productTag
940
951
*
941
952
* @return Product
942
953
*/
@@ -950,7 +961,7 @@ public function addProductTag(ProductTag $productTag)
950
961
/**
951
962
* Remove productTag.
952
963
*
953
- * @param \Eccube\Entity\ ProductTag $productTag
964
+ * @param ProductTag $productTag
954
965
*
955
966
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
956
967
*/
@@ -984,7 +995,7 @@ public function getTags()
984
995
}
985
996
986
997
usort ($ tags , function (Tag $ tag1 , Tag $ tag2 ) {
987
- return $ tag1 ->getSortNo () < $ tag2 ->getSortNo ();
998
+ return $ tag1 ->getSortNo () <=> $ tag2 ->getSortNo ();
988
999
});
989
1000
990
1001
return $ tags ;
@@ -993,7 +1004,7 @@ public function getTags()
993
1004
/**
994
1005
* Add customerFavoriteProduct.
995
1006
*
996
- * @param \Eccube\Entity\ CustomerFavoriteProduct $customerFavoriteProduct
1007
+ * @param CustomerFavoriteProduct $customerFavoriteProduct
997
1008
*
998
1009
* @return Product
999
1010
*/
@@ -1007,7 +1018,7 @@ public function addCustomerFavoriteProduct(CustomerFavoriteProduct $customerFavo
1007
1018
/**
1008
1019
* Remove customerFavoriteProduct.
1009
1020
*
1010
- * @param \Eccube\Entity\ CustomerFavoriteProduct $customerFavoriteProduct
1021
+ * @param CustomerFavoriteProduct $customerFavoriteProduct
1011
1022
*
1012
1023
* @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
1013
1024
*/
@@ -1029,11 +1040,11 @@ public function getCustomerFavoriteProducts()
1029
1040
/**
1030
1041
* Set creator.
1031
1042
*
1032
- * @param \Eccube\Entity\ Member|null $creator
1043
+ * @param Member|null $creator
1033
1044
*
1034
1045
* @return Product
1035
1046
*/
1036
- public function setCreator (Member $ creator = null )
1047
+ public function setCreator (? Member $ creator = null )
1037
1048
{
1038
1049
$ this ->Creator = $ creator ;
1039
1050
@@ -1043,7 +1054,7 @@ public function setCreator(Member $creator = null)
1043
1054
/**
1044
1055
* Get creator.
1045
1056
*
1046
- * @return \Eccube\Entity\ Member|null
1057
+ * @return Member|null
1047
1058
*/
1048
1059
public function getCreator ()
1049
1060
{
@@ -1053,11 +1064,11 @@ public function getCreator()
1053
1064
/**
1054
1065
* Set status.
1055
1066
*
1056
- * @param \Eccube\Entity\ Master\ProductStatus|null $status
1067
+ * @param Master\ProductStatus|null $status
1057
1068
*
1058
1069
* @return Product
1059
1070
*/
1060
- public function setStatus (Master \ProductStatus $ status = null )
1071
+ public function setStatus (? Master \ProductStatus $ status = null )
1061
1072
{
1062
1073
$ this ->Status = $ status ;
1063
1074
@@ -1067,7 +1078,7 @@ public function setStatus(Master\ProductStatus $status = null)
1067
1078
/**
1068
1079
* Get status.
1069
1080
*
1070
- * @return \Eccube\Entity\ Master\ProductStatus|null
1081
+ * @return Master\ProductStatus|null
1071
1082
*/
1072
1083
public function getStatus ()
1073
1084
{
0 commit comments