2010-09-21 23:53:26 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Doctrine\Tests\Models\DirectoryTree;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @MappedSuperclass
|
|
|
|
*/
|
|
|
|
abstract class AbstractContentItem
|
|
|
|
{
|
2015-01-20 15:25:35 +01:00
|
|
|
const CLASSNAME = __CLASS__;
|
|
|
|
|
2010-09-21 23:53:26 +02:00
|
|
|
/**
|
|
|
|
* @Id @Column(type="integer") @GeneratedValue
|
|
|
|
*/
|
|
|
|
private $id;
|
2011-12-19 22:56:19 +01:00
|
|
|
|
2010-09-21 23:53:26 +02:00
|
|
|
/**
|
|
|
|
* @ManyToOne(targetEntity="Directory")
|
|
|
|
*/
|
|
|
|
protected $parentDirectory;
|
|
|
|
|
|
|
|
/** @column(type="string") */
|
|
|
|
protected $name;
|
|
|
|
|
2015-01-20 15:25:35 +01:00
|
|
|
/**
|
|
|
|
* This field is transient and private on purpose
|
|
|
|
*
|
|
|
|
* @var bool
|
|
|
|
*/
|
|
|
|
private $nodeIsLoaded = false;
|
|
|
|
|
2015-01-20 15:30:47 +01:00
|
|
|
/**
|
|
|
|
* This field is transient on purpose
|
|
|
|
*
|
|
|
|
* @var mixed
|
|
|
|
*/
|
|
|
|
public static $fileSystem;
|
|
|
|
|
2010-09-22 00:15:45 +02:00
|
|
|
public function __construct(Directory $parentDir = null)
|
2010-09-21 23:53:26 +02:00
|
|
|
{
|
2010-09-22 00:15:45 +02:00
|
|
|
$this->parentDirectory = $parentDir;
|
2010-09-21 23:53:26 +02:00
|
|
|
}
|
|
|
|
|
2010-09-22 00:15:45 +02:00
|
|
|
public function getId()
|
2010-09-21 23:53:26 +02:00
|
|
|
{
|
2010-09-22 00:15:45 +02:00
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setName($name)
|
|
|
|
{
|
|
|
|
$this->name = $name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getName()
|
|
|
|
{
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getParent()
|
|
|
|
{
|
|
|
|
return $this->parentDirectory;
|
2010-09-21 23:53:26 +02:00
|
|
|
}
|
2015-01-20 15:25:35 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function getNodeIsLoaded()
|
|
|
|
{
|
|
|
|
return $this->nodeIsLoaded;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param bool $nodeIsLoaded
|
|
|
|
*/
|
|
|
|
public function setNodeIsLoaded($nodeIsLoaded)
|
|
|
|
{
|
|
|
|
$this->nodeIsLoaded = (bool) $nodeIsLoaded;
|
|
|
|
}
|
2010-09-21 23:53:26 +02:00
|
|
|
}
|