for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Symfony CMF package.
*
* (c) 2011-2017 Symfony CMF
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\DoctrinePHPCRAdminBundle\Tests\Resources\Document;
use Doctrine\ODM\PHPCR\Mapping\Annotations as PHPCRODM;
use PHPCR\NodeInterface;
/**
* @PHPCRODM\Document(referenceable=true)
class Content
{
* @PHPCRODM\Id
protected $id;
* @PHPCRODM\Node
protected $node;
* @PHPCRODM\ParentDocument
protected $parentDocument;
* @PHPCRODM\Nodename
protected $name;
* @PHPCRODM\Field(type="string")
protected $title;
* @return mixed
public function getId()
return $this->id;
}
* Gets the underlying PHPCR node of this content.
* @return NodeInterface
public function getNode()
return $this->node;
* Sets the parent document.
* @param object $parent the parent document
public function setParentDocument($parent)
$this->parentDocument = $parent;
return $this;
* Gets the parent document.
* @return object
public function getParentDocument()
return $this->parentDocument;
* Sets the document name.
* @param string $name
public function setName($name)
$this->name = $name;
* Gets the document name.
* @return string
public function getName()
return $this->name;
public function getTitle()
return $this->title;
* @param string $title
public function setTitle($title)
$this->title = $title;
public function getBody()
return $this->body;
body
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
* @param string $body
public function setBody($body)
$this->body = $body;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: