| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  |  * This file is part of the eav package. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * @author    Aleksandr Drobotik <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * @copyright 2023 Aleksandr Drobotik | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * @license   https://opensource.org/license/mit  The MIT License | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  | declare(strict_types=1); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  | namespace Drobotik\Eav\Traits; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  | use Drobotik\Eav\AttributeContainer; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  | use Drobotik\Eav\AttributeSet; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  | use Drobotik\Eav\Factory\EavFactory; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  | use Drobotik\Eav\Model\AttributeGroupModel; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  | use Drobotik\Eav\Model\AttributeModel; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  | use Drobotik\Eav\Model\AttributeSetModel; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | use Drobotik\Eav\Model\DomainModel; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | use Drobotik\Eav\Model\EntityModel; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | use Drobotik\Eav\Model\PivotModel; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  | use Drobotik\Eav\Model\ValueBase; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | use Drobotik\Eav\Value\ValueParser; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  | use Faker\Factory; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  | use Faker\Generator; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  | trait SingletonsTrait | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 | 1 |  |     public function makeAttributeSetModel() : AttributeSetModel | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 | 1 |  |         return new AttributeSetModel; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 32 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 33 | 1 |  |     public function makeAttributeContainer() : AttributeContainer | 
            
                                                                        
                            
            
                                    
            
            
                | 34 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 35 | 1 |  |         return new AttributeContainer; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 | 1 |  |     public function makeEntityModel() : EntityModel | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 | 1 |  |         return new EntityModel(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 | 1 |  |     public function makeAttributeSet() : AttributeSet | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 | 1 |  |         return new AttributeSet(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 | 1 |  |     public function makeDomainModel() : DomainModel | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 | 1 |  |         return new DomainModel(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 | 1 |  |     public function makeGroupModel() : AttributeGroupModel | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 | 1 |  |         return new AttributeGroupModel(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 57 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 58 | 1 |  |     public function makePivotModel() : PivotModel | 
            
                                                                                                            
                            
            
                                    
            
            
                | 59 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 60 | 1 |  |         return new PivotModel(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 61 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 62 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 63 | 1 |  |     public function makeValueModel() : ValueBase | 
            
                                                                                                            
                            
            
                                    
            
            
                | 64 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 | 1 |  |         return new ValueBase(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 67 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 68 | 1 |  |     public function makeAttributeModel() : AttributeModel | 
            
                                                                                                            
                            
            
                                    
            
            
                | 69 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 70 | 1 |  |         return new AttributeModel(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 71 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 72 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 73 | 1 |  |     public function makeEavFactory(): EavFactory | 
            
                                                                                                            
                            
            
                                    
            
            
                | 74 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 75 | 1 |  |         return new EavFactory(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 76 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 77 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 78 | 1 |  |     public function makeValueParser(): ValueParser | 
            
                                                                                                            
                            
            
                                    
            
            
                | 79 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 80 | 1 |  |         return new ValueParser(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 81 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 82 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 83 | 1 |  |     public function makeFakerGenerator(): Generator | 
            
                                                                                                            
                            
            
                                    
            
            
                | 84 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 85 | 1 |  |         return Factory::create(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 86 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 87 |  |  |  | 
            
                                                        
            
                                    
            
            
                | 88 |  |  | } |