1 | <?php |
||
41 | class ProductRepository extends AbstractFinderRepository implements ProductRepositoryInterface |
||
42 | { |
||
43 | |||
44 | /** |
||
45 | * The primary key utility instance. |
||
46 | * |
||
47 | * @var \TechDivision\Import\Utils\PrimaryKeyUtilInterface |
||
48 | */ |
||
49 | protected $primaryKeyUtil; |
||
50 | |||
51 | /** |
||
52 | * Initialize the repository with the passed connection and utility class name. |
||
53 | * . |
||
54 | * @param \TechDivision\Import\Connection\ConnectionInterface $connection The connection instance |
||
55 | * @param \TechDivision\Import\Repositories\SqlStatementRepositoryInterface $sqlStatementRepository The SQL repository instance |
||
56 | * @param \TechDivision\Import\Repositories\Finders\FinderFactoryInterface $finderFactory The finder factory instance |
||
57 | * @param \TechDivision\Import\Utils\PrimaryKeyUtilInterface $primaryKeyUtil The primary key utility instance |
||
58 | */ |
||
59 | public function __construct( |
||
72 | |||
73 | /** |
||
74 | * Initializes the repository's prepared statements. |
||
75 | * |
||
76 | * @return void |
||
77 | */ |
||
78 | public function init() |
||
85 | |||
86 | /** |
||
87 | * Return's the finder's entity name. |
||
88 | * |
||
89 | * @return string The finder's entity name |
||
90 | */ |
||
91 | public function getEntityName() |
||
95 | |||
96 | /** |
||
97 | * Return's the primary key name of the entity. |
||
98 | * |
||
99 | * @return string The name of the entity's primary key |
||
100 | */ |
||
101 | public function getPrimaryKeyName() |
||
105 | |||
106 | /** |
||
107 | * Return's the entity unique key name. |
||
108 | * |
||
109 | * @return string The name of the entity's unique key |
||
110 | */ |
||
111 | public function getUniqueKeyName() |
||
115 | |||
116 | /** |
||
117 | * Return's the available products. |
||
118 | * |
||
119 | * @return array The available products |
||
120 | */ |
||
121 | public function findAll() |
||
127 | |||
128 | /** |
||
129 | * Return's the product with the passed SKU. |
||
130 | * |
||
131 | * @param string $sku The SKU of the product to return |
||
132 | * |
||
133 | * @return array|null The product |
||
134 | */ |
||
135 | public function findOneBySku($sku) |
||
139 | } |
||
140 |