Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace WL\Test\Domain\Model;
- use TYPO3\Flow\Annotations as Flow;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * A Master
- *
- * @Flow\Entity
- */
- class Master {
- /**
- * The name
- * @var string
- */
- protected $name;
- /**
- * @var \WL\Test\Domain\Model\Image
- * @ORM\ManyToMany
- */
- protected $image;
- /**
- * Get the Master's name
- *
- * @return string The Master's name
- */
- public function getName() {
- return $this->name;
- }
- /**
- * Sets this Master's name
- *
- * @param string $name The Master's name
- * @return void
- */
- public function setName($name) {
- $this->name = $name;
- }
- /**
- * @param return \WL\Test\Domain\Model\Image $image
- * @return void
- */
- public function setImage(\WL\Test\Domain\Model\Image $image) {
- $this->picture = $image;
- }
- /**
- * @return \WL\Test\Domain\Model\Image
- */
- public function getImage() {
- return $this->image;
- }
- }
- ?>
- ###########################################################################################
- <?php
- namespace WL\Test\Domain\Model;
- use Doctrine\ORM\Mapping as ORM;
- use TYPO3\Flow\Annotations as Flow;
- /**
- * An image
- *
- * @Flow\Scope("prototype")
- * @Flow\Entity
- */
- class Image {
- /**
- * @var string
- */
- protected $title;
- /**
- * @var \TYPO3\Flow\Resource\Resource
- * @ORM\ManyToOne
- * @Flow\Validate(type="NotEmpty")
- */
- protected $originalResource;
- /**
- * @param string $title
- * @return void
- */
- public function setTitle($title) {
- $this->title = $title;
- }
- /**
- * @return string The title
- */
- public function getTitle() {
- return $this->title;
- }
- /**
- * @param \TYPO3\Flow\Resource\Resource $originalResource
- * @return void
- */
- public function setOriginalResource(\TYPO3\Flow\Resource\Resource $originalResource) {
- $this->originalResource = $originalResource;
- }
- /**
- * @return \TYPO3\Flow\Resource\Resource $originalResource
- */
- public function getOriginalResource() {
- return $this->originalResource;
- }
- }
- #####################################FORM########################################
- <f:form action="create" name="newMaster" object="newMaster" enctype="multipart/form-data">
- <label for="name">Name</label>
- <f:form.textfield property="name" id="name" />
- <f:form.hidden property="image.title" value="newpic"/>
- <f:form.upload property="image.originalResource" />
- <f:form.submit value="Create" />
- </f:form>
Advertisement
Add Comment
Please, Sign In to add comment