daux.io/libs/Tree/Content.php
2015-07-20 20:51:32 +02:00

41 lignes
695 B
PHP

<?php namespace Todaymade\Daux\Tree;
use Todaymade\Daux\DauxHelper;
class Content extends Entry
{
/**
* @var string
*/
protected $content;
/**
* @return string
*/
public function getContent()
{
if (!$this->content) {
$this->content = file_get_contents($this->getPath());
}
return $this->content;
}
/**
* @param string $content
*/
public function setContent($content)
{
$this->content = $content;
}
/**
* @param string $file
* @return string
*/
protected function getFilename($file)
{
return DauxHelper::pathinfo($file)['filename'];
}
}