2013-11-01 20:11:03 +01:00
|
|
|
<?php
|
|
|
|
namespace OliverKlee\Tea\Domain\Model;
|
|
|
|
|
2014-12-10 21:18:45 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the TYPO3 CMS project.
|
2013-11-01 20:11:03 +01:00
|
|
|
*
|
2014-12-10 21:18:45 +01:00
|
|
|
* It is free software; you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU General Public License, either version 2
|
|
|
|
* of the License, or any later version.
|
2013-11-01 20:11:03 +01:00
|
|
|
*
|
2014-12-10 21:18:45 +01:00
|
|
|
* For the full copyright and license information, please read the
|
|
|
|
* LICENSE.txt file that was distributed with this source code.
|
2013-11-01 20:11:03 +01:00
|
|
|
*
|
2014-12-10 21:18:45 +01:00
|
|
|
* The TYPO3 project - inspiring people to share!
|
|
|
|
*/
|
2013-11-01 20:11:03 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This model represents a good cup of tea.
|
|
|
|
*
|
|
|
|
* @author Oliver Klee <typo3-coding@oliverklee.de>
|
|
|
|
*/
|
|
|
|
class TeaBeverage extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
|
|
|
|
/**
|
2013-11-01 21:21:03 +01:00
|
|
|
* @var float
|
2013-11-01 20:11:03 +01:00
|
|
|
*/
|
|
|
|
protected $size = 0.0;
|
|
|
|
|
|
|
|
/**
|
2013-11-01 20:51:53 +01:00
|
|
|
* @var \OliverKlee\Tea\Domain\Model\TeaType
|
|
|
|
* @lazy
|
|
|
|
*/
|
|
|
|
protected $type = NULL;
|
|
|
|
|
|
|
|
/**
|
2013-11-01 21:21:03 +01:00
|
|
|
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OliverKlee\Tea\Domain\Model\Addition>
|
|
|
|
* @lazy
|
|
|
|
*/
|
|
|
|
protected $additions = NULL;
|
|
|
|
|
2013-11-01 22:03:14 +01:00
|
|
|
/**
|
|
|
|
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OliverKlee\Tea\Domain\Model\Testimonial>
|
|
|
|
* @lazy
|
|
|
|
*/
|
|
|
|
protected $testimonials = NULL;
|
|
|
|
|
2013-11-01 21:21:03 +01:00
|
|
|
/**
|
|
|
|
* The constructor.
|
|
|
|
*
|
|
|
|
* @return TeaBeverage
|
|
|
|
*/
|
|
|
|
public function __construct() {
|
|
|
|
$this->initializeStorageObjects();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initializes all ObjectStorage properties.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function initializeStorageObjects() {
|
|
|
|
$this->additions = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
2013-11-01 22:03:14 +01:00
|
|
|
$this->testimonials = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
|
2013-11-01 21:21:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return float $size
|
2013-11-01 20:11:03 +01:00
|
|
|
*/
|
|
|
|
public function getSize() {
|
|
|
|
return $this->size;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-11-01 21:21:03 +01:00
|
|
|
* @param float $size
|
2013-11-01 20:51:53 +01:00
|
|
|
*
|
2013-11-01 20:11:03 +01:00
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function setSize($size) {
|
|
|
|
$this->size = $size;
|
|
|
|
}
|
2013-11-01 20:51:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return \OliverKlee\Tea\Domain\Model\TeaType $type
|
|
|
|
*/
|
|
|
|
public function getType() {
|
|
|
|
return $this->type;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \OliverKlee\Tea\Domain\Model\TeaType $type
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function setType(\OliverKlee\Tea\Domain\Model\TeaType $type) {
|
|
|
|
$this->type = $type;
|
|
|
|
}
|
2013-11-01 21:21:03 +01:00
|
|
|
|
2013-11-01 22:03:14 +01:00
|
|
|
/**
|
|
|
|
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OliverKlee\Tea\Domain\Model\Addition> $additions
|
|
|
|
*/
|
|
|
|
public function getAdditions() {
|
|
|
|
return $this->additions;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OliverKlee\Tea\Domain\Model\Addition> $additions
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function setAdditions(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $additions) {
|
|
|
|
$this->additions = $additions;
|
|
|
|
}
|
|
|
|
|
2013-11-01 21:21:03 +01:00
|
|
|
/**
|
|
|
|
* Adds an Addition.
|
|
|
|
*
|
|
|
|
* @param \OliverKlee\Tea\Domain\Model\Addition $addition
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function addAddition(\OliverKlee\Tea\Domain\Model\Addition $addition) {
|
|
|
|
$this->additions->attach($addition);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes an Addition.
|
|
|
|
*
|
|
|
|
* @param \OliverKlee\Tea\Domain\Model\Addition $additionToRemove The Addition to be removed
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function removeAddition(\OliverKlee\Tea\Domain\Model\Addition $additionToRemove) {
|
|
|
|
$this->additions->detach($additionToRemove);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-11-01 22:03:14 +01:00
|
|
|
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OliverKlee\Tea\Domain\Model\Testimonial> $testimonials
|
|
|
|
*/
|
|
|
|
public function getTestimonials() {
|
|
|
|
return $this->testimonials;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\OliverKlee\Tea\Domain\Model\Testimonial> $testimonials
|
2013-11-01 21:21:03 +01:00
|
|
|
*
|
2013-11-01 22:03:14 +01:00
|
|
|
* @return void
|
2013-11-01 21:21:03 +01:00
|
|
|
*/
|
2013-11-01 22:03:14 +01:00
|
|
|
public function setTestimonials(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $testimonials) {
|
|
|
|
$this->testimonials = $testimonials;
|
2013-11-01 21:21:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-11-01 22:03:14 +01:00
|
|
|
* Adds an Testimonial.
|
2013-11-01 21:21:03 +01:00
|
|
|
*
|
2013-11-01 22:03:14 +01:00
|
|
|
* @param \OliverKlee\Tea\Domain\Model\Testimonial $testimonial
|
2013-11-01 21:21:03 +01:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2013-11-01 22:03:14 +01:00
|
|
|
public function addTestimonial(\OliverKlee\Tea\Domain\Model\Testimonial $testimonial) {
|
|
|
|
$this->testimonials->attach($testimonial);
|
2013-11-01 21:21:03 +01:00
|
|
|
}
|
2013-11-01 22:03:14 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes an Testimonial.
|
|
|
|
*
|
|
|
|
* @param \OliverKlee\Tea\Domain\Model\Testimonial $testimonialToRemove The Testimonial to be removed
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function removeTestimonial(\OliverKlee\Tea\Domain\Model\Testimonial $testimonialToRemove) {
|
|
|
|
$this->testimonials->detach($testimonialToRemove);
|
|
|
|
}
|
2013-12-23 13:24:40 +01:00
|
|
|
}
|