-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
132 additions
and
22 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,97 @@ | ||
<?php | ||
|
||
namespace Drupal\yandex_yml\YandexYml\Param; | ||
|
||
use Drupal\yandex_yml\Annotation\YandexYmlElement; | ||
use Drupal\yandex_yml\Annotation\YandexYmlAttribute; | ||
use Drupal\yandex_yml\Annotation\YandexYmlValue; | ||
use Drupal\yandex_yml\YandexYml\YandexYmlToArrayTrait; | ||
|
||
/** | ||
* Class YandexYmlParam | ||
* | ||
* Used as abstraction for YML element. | ||
* | ||
* @YandexYmlElement( | ||
* name = "param" | ||
* ) | ||
* | ||
* @package Drupal\yandex_yml\YandexYml\Param | ||
*/ | ||
class YandexYmlParam { | ||
|
||
use YandexYmlToArrayTrait; | ||
|
||
/** | ||
* @YandexYmlAttribute() | ||
* | ||
* @var string | ||
*/ | ||
private $name; | ||
|
||
/** | ||
* @YandexYmlAttribute() | ||
* | ||
* @var string | ||
*/ | ||
private $unit; | ||
|
||
/** | ||
* @YandexYmlValue() | ||
* | ||
* @var string | ||
*/ | ||
private $value; | ||
|
||
/** | ||
* @param string $name | ||
* | ||
* @return YandexYmlParam | ||
*/ | ||
public function setName($name) { | ||
$this->name = $name; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName() { | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* @param string $unit | ||
* | ||
* @return YandexYmlParam | ||
*/ | ||
public function setUnit($unit) { | ||
$this->unit = $unit; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getUnit() { | ||
return $this->unit; | ||
} | ||
|
||
/** | ||
* @param string $value | ||
* | ||
* @return YandexYmlParam | ||
*/ | ||
public function setValue($value) { | ||
$this->value = $value; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getValue() { | ||
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