Skip to content

Commit

Permalink
phpdoc and type hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
Alain Horner committed Feb 22, 2013
1 parent 24c9645 commit f7ffa8d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Document/Image.php
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\Bundle\PHPCRBundle\Document;

use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
use Doctrine\ODM\PHPCR\Document\File;

/**
* @PHPCRODM\Document(referenceable=true)
Expand All @@ -23,31 +24,49 @@ class Image
protected $file;


public function setFile($file)
/**
* @param $file File
*/
public function setFile(File $file)
{
$this->file = $file;
}

/**
* @return File
*/
public function getFile()
{
return $this->file;
}

/**
* @param $mimeType string
*/
public function setMimeType($mimeType)
{
$this->file->getContent()->setMimeType($mimeType);
}

/**
* @return string
*/
public function getMimeType()
{
return $this->file->getContent()->getMimeType();
}

/**
* @return stream
*/
public function getContent()
{
return $this->file->getFileContentAsStream();
}

/**
* @return string
*/
public function __toString()
{
return $this->path;
Expand Down

0 comments on commit f7ffa8d

Please sign in to comment.