-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from EmicoEcommerce/feat/TW-44-visuals
feat: Implemented visuals functionality
- Loading branch information
Showing
11 changed files
with
239 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Tweakwise\Magento2Tweakwise\Api\Data; | ||
|
||
interface VisualInterface | ||
{ | ||
public const IMAGE_URL = 'image'; | ||
public const URL = 'url'; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getImageUrl(): string; | ||
|
||
/** | ||
* @param string $imageUrl | ||
* @return self | ||
*/ | ||
public function setImageUrl(string $imageUrl): self; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getUrl(): string; | ||
|
||
/** | ||
* @param string $url | ||
* @return self | ||
*/ | ||
public function setUrl(string $url): self; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tweakwise\Magento2Tweakwise\Model\Enum; | ||
|
||
enum ItemType: string | ||
{ | ||
case VISUAL = 'visual'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Tweakwise\Magento2Tweakwise\Model; | ||
|
||
use Magento\Catalog\Model\Product; | ||
use Tweakwise\Magento2Tweakwise\Api\Data\VisualInterface; | ||
|
||
class Visual extends Product implements VisualInterface | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getImageUrl(): string | ||
{ | ||
return $this->getData(self::IMAGE_URL); | ||
} | ||
|
||
/** | ||
* @param string $imageUrl | ||
* @return VisualInterface | ||
*/ | ||
public function setImageUrl(string $imageUrl): VisualInterface | ||
{ | ||
return $this->setData(self::IMAGE_URL, $imageUrl); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getUrl(): string | ||
{ | ||
return $this->getData(self::URL); | ||
} | ||
|
||
/** | ||
* @param string $url | ||
* @return VisualInterface | ||
*/ | ||
public function setUrl(string $url): VisualInterface | ||
{ | ||
return $this->setData(self::URL, $url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.