-
Notifications
You must be signed in to change notification settings - Fork 16
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 #51 from pamkil/master
fix YmlAttributes name
- Loading branch information
Showing
9 changed files
with
180 additions
and
40 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
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,33 @@ | ||
<?php | ||
|
||
namespace pastuhov\ymlcatalog; | ||
|
||
/** | ||
* Элемент param предназначен для описания характеристик и параметров товара. | ||
* | ||
* @link https://yandex.ru/support/partnermarket/param.html | ||
* @package pastuhov\yml | ||
*/ | ||
interface ParamOfferInterface | ||
{ | ||
/** | ||
* Название параметра (обязательно). | ||
* | ||
* @return string | ||
*/ | ||
public function getName(); | ||
|
||
/** | ||
* Значение параметра. | ||
* | ||
* @return string | ||
*/ | ||
public function getValue(); | ||
|
||
/** | ||
* Единицы измерения (для числовых параметров, опционально). | ||
* | ||
* @return string | ||
*/ | ||
public function getUnit(); | ||
} |
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,56 @@ | ||
<?php | ||
|
||
namespace pastuhov\ymlcatalog\models; | ||
|
||
/** | ||
* Class ParamOffer | ||
* Модель все важные характеристики товара — цвет, размер, объем, материал, вес, возраст, пол, и т. д. | ||
* | ||
* @package pastuhov\ymlcatalog\models | ||
*/ | ||
class ParamOffer extends BaseModel | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public static $tag = 'param'; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public static $tagProperties = [ | ||
'name', | ||
'unit', | ||
]; | ||
|
||
/** @var string Название параметра. */ | ||
public $name; | ||
|
||
/** @var string Единицы измерения. */ | ||
public $unit; | ||
|
||
/** @var string Значение параметра. */ | ||
public $value; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function rules() | ||
{ | ||
return [ | ||
[ | ||
['name', 'value'], | ||
'required', | ||
], | ||
[ | ||
['name', 'value', 'unit'], | ||
'string', | ||
], | ||
]; | ||
} | ||
|
||
protected function getYmlBody() | ||
{ | ||
return $this->value; | ||
} | ||
} |
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.