public function Crop::position in Crop API 8
Same name and namespace in other branches
- 8.2 src/Entity/Crop.php \Drupal\crop\Entity\Crop::position()
Gets position of crop's center.
Return value
array Array with two keys (x, y) and center coordinates as values.
Overrides CropInterface::position
File
- src/
Entity/ Crop.php, line 62
Class
- Crop
- Defines the crop entity class.
Namespace
Drupal\crop\EntityCode
public function position() {
return [
'x' => (int) $this->x->value,
'y' => (int) $this->y->value,
];
}