| @@ 34-80 (lines=47) @@ | ||
| 31 | * @link https://github.com/techdivision/import-category |
|
| 32 | * @link http://www.techdivision.com |
|
| 33 | */ |
|
| 34 | class StoreAction extends AbstractAction |
|
| 35 | { |
|
| 36 | ||
| 37 | /** |
|
| 38 | * Helper method that create/update the passed entity, depending on |
|
| 39 | * the entity's status. |
|
| 40 | * |
|
| 41 | * @param array $row The entity data to create/update |
|
| 42 | * |
|
| 43 | * @return string The last inserted ID |
|
| 44 | */ |
|
| 45 | public function persist(array $row) |
|
| 46 | { |
|
| 47 | ||
| 48 | // load the method name |
|
| 49 | $methodName = $row[EntityStatus::MEMBER_NAME]; |
|
| 50 | ||
| 51 | // invoke the method |
|
| 52 | return $this->$methodName($row); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Creates's the entity with the passed attributes. |
|
| 57 | * |
|
| 58 | * @param array $row The attributes of the entity to create |
|
| 59 | * @param string|null $name The name of the prepared statement that has to be executed |
|
| 60 | * |
|
| 61 | * @return string The last inserted ID |
|
| 62 | */ |
|
| 63 | public function create($row, $name = null) |
|
| 64 | { |
|
| 65 | return $this->getCreateProcessor()->execute($row, $name); |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * Update's the entity with the passed attributes. |
|
| 70 | * |
|
| 71 | * @param array $row The attributes of the entity to update |
|
| 72 | * @param string|null $name The name of the prepared statement that has to be executed |
|
| 73 | * |
|
| 74 | * @return string The ID of the updated product |
|
| 75 | */ |
|
| 76 | public function update($row, $name = null) |
|
| 77 | { |
|
| 78 | return $this->getUpdateProcessor()->execute($row, $name); |
|
| 79 | } |
|
| 80 | } |
|
| 81 | ||
| @@ 34-80 (lines=47) @@ | ||
| 31 | * @link https://github.com/techdivision/import-category |
|
| 32 | * @link http://www.techdivision.com |
|
| 33 | */ |
|
| 34 | class StoreGroupAction extends AbstractAction |
|
| 35 | { |
|
| 36 | ||
| 37 | /** |
|
| 38 | * Helper method that create/update the passed entity, depending on |
|
| 39 | * the entity's status. |
|
| 40 | * |
|
| 41 | * @param array $row The entity data to create/update |
|
| 42 | * |
|
| 43 | * @return string The last inserted ID |
|
| 44 | */ |
|
| 45 | public function persist(array $row) |
|
| 46 | { |
|
| 47 | ||
| 48 | // load the method name |
|
| 49 | $methodName = $row[EntityStatus::MEMBER_NAME]; |
|
| 50 | ||
| 51 | // invoke the method |
|
| 52 | return $this->$methodName($row); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Creates's the entity with the passed attributes. |
|
| 57 | * |
|
| 58 | * @param array $row The attributes of the entity to create |
|
| 59 | * @param string|null $name The name of the prepared statement that has to be executed |
|
| 60 | * |
|
| 61 | * @return string The last inserted ID |
|
| 62 | */ |
|
| 63 | public function create($row, $name = null) |
|
| 64 | { |
|
| 65 | return $this->getCreateProcessor()->execute($row, $name); |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * Update's the entity with the passed attributes. |
|
| 70 | * |
|
| 71 | * @param array $row The attributes of the entity to update |
|
| 72 | * @param string|null $name The name of the prepared statement that has to be executed |
|
| 73 | * |
|
| 74 | * @return string The ID of the updated product |
|
| 75 | */ |
|
| 76 | public function update($row, $name = null) |
|
| 77 | { |
|
| 78 | return $this->getUpdateProcessor()->execute($row, $name); |
|
| 79 | } |
|
| 80 | } |
|
| 81 | ||
| @@ 34-80 (lines=47) @@ | ||
| 31 | * @link https://github.com/techdivision/import-category |
|
| 32 | * @link http://www.techdivision.com |
|
| 33 | */ |
|
| 34 | class StoreWebsiteAction extends AbstractAction |
|
| 35 | { |
|
| 36 | ||
| 37 | /** |
|
| 38 | * Helper method that create/update the passed entity, depending on |
|
| 39 | * the entity's status. |
|
| 40 | * |
|
| 41 | * @param array $row The entity data to create/update |
|
| 42 | * |
|
| 43 | * @return string The last inserted ID |
|
| 44 | */ |
|
| 45 | public function persist(array $row) |
|
| 46 | { |
|
| 47 | ||
| 48 | // load the method name |
|
| 49 | $methodName = $row[EntityStatus::MEMBER_NAME]; |
|
| 50 | ||
| 51 | // invoke the method |
|
| 52 | return $this->$methodName($row); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Creates's the entity with the passed attributes. |
|
| 57 | * |
|
| 58 | * @param array $row The attributes of the entity to create |
|
| 59 | * @param string|null $name The name of the prepared statement that has to be executed |
|
| 60 | * |
|
| 61 | * @return string The last inserted ID |
|
| 62 | */ |
|
| 63 | public function create($row, $name = null) |
|
| 64 | { |
|
| 65 | return $this->getCreateProcessor()->execute($row, $name); |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * Update's the entity with the passed attributes. |
|
| 70 | * |
|
| 71 | * @param array $row The attributes of the entity to update |
|
| 72 | * @param string|null $name The name of the prepared statement that has to be executed |
|
| 73 | * |
|
| 74 | * @return string The ID of the updated product |
|
| 75 | */ |
|
| 76 | public function update($row, $name = null) |
|
| 77 | { |
|
| 78 | return $this->getUpdateProcessor()->execute($row, $name); |
|
| 79 | } |
|
| 80 | } |
|
| 81 | ||
| @@ 34-80 (lines=47) @@ | ||
| 31 | * @link https://github.com/techdivision/import-category |
|
| 32 | * @link http://www.techdivision.com |
|
| 33 | */ |
|
| 34 | class UrlRewriteAction extends AbstractAction |
|
| 35 | { |
|
| 36 | ||
| 37 | /** |
|
| 38 | * Helper method that create/update the passed entity, depending on |
|
| 39 | * the entity's status. |
|
| 40 | * |
|
| 41 | * @param array $row The entity data to create/update |
|
| 42 | * |
|
| 43 | * @return string The last inserted ID |
|
| 44 | */ |
|
| 45 | public function persist(array $row) |
|
| 46 | { |
|
| 47 | ||
| 48 | // load the method name |
|
| 49 | $methodName = $row[EntityStatus::MEMBER_NAME]; |
|
| 50 | ||
| 51 | // invoke the method |
|
| 52 | return $this->$methodName($row); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Creates's the entity with the passed attributes. |
|
| 57 | * |
|
| 58 | * @param array $row The attributes of the entity to create |
|
| 59 | * @param string|null $name The name of the prepared statement that has to be executed |
|
| 60 | * |
|
| 61 | * @return string The last inserted ID |
|
| 62 | */ |
|
| 63 | public function create($row, $name = null) |
|
| 64 | { |
|
| 65 | return $this->getCreateProcessor()->execute($row, $name); |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * Update's the entity with the passed attributes. |
|
| 70 | * |
|
| 71 | * @param array $row The attributes of the entity to update |
|
| 72 | * @param string|null $name The name of the prepared statement that has to be executed |
|
| 73 | * |
|
| 74 | * @return string The ID of the updated product |
|
| 75 | */ |
|
| 76 | public function update($row, $name = null) |
|
| 77 | { |
|
| 78 | return $this->getUpdateProcessor()->execute($row, $name); |
|
| 79 | } |
|
| 80 | } |
|
| 81 | ||