-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
db10c4e
commit d7dbbe7
Showing
3 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Tapestry\Modules\Source; | ||
|
||
use Tapestry\Entities\Permalink; | ||
|
||
abstract class AbstractSource implements SourceInterface | ||
{ | ||
|
||
/** | ||
* File meta data, usually from front matter or site config. | ||
* | ||
* @var array | ||
*/ | ||
protected $meta = []; | ||
|
||
/** | ||
* The Permalink object attached to this file. | ||
* | ||
* @var Permalink | ||
*/ | ||
protected $permalink; | ||
|
||
/** | ||
* This is the files rendered content as set by `setRenderedContent`. | ||
* | ||
* @var bool|string | ||
*/ | ||
protected $content = false; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace Tapestry\Modules\Source; | ||
|
||
use Tapestry\Entities\Permalink; | ||
|
||
interface SourceInterface | ||
{ | ||
public function getUid() : string; | ||
|
||
public function setUid(string $uid); | ||
|
||
public function setData(string $key, $value = null); | ||
|
||
public function setDataFromArray(array $data); | ||
|
||
public function getData(string $key = null, $default = null); | ||
|
||
public function hasData(string $key) : bool; | ||
|
||
public function getRawContent() : string; | ||
|
||
public function setRenderedContent(string $content); | ||
|
||
public function getRenderedContent() : string; | ||
|
||
public function getPermalink() : Permalink; | ||
|
||
public function getCompiledPermalink() : string; | ||
|
||
public function setOverloaded(string $key, $value); | ||
|
||
public function getFilename(bool $overloaded = true) : string; | ||
|
||
public function getExtension(bool $overloaded = true) : string; | ||
|
||
public function hasChanged() : bool; | ||
|
||
public function setHasChanged(bool $value = true); | ||
|
||
public function isRendered() : bool; | ||
|
||
public function setRendered(bool $value = true); | ||
|
||
public function isToCopy() : bool; | ||
|
||
public function setToCopy(bool $value = true); | ||
|
||
public function isIgnored() : bool; | ||
|
||
public function setIgnored(bool $value = true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
<?php | ||
|
||
namespace Tapestry\Modules\Source; | ||
|
||
use Tapestry\Entities\Permalink; | ||
|
||
class SplFileSource extends AbstractSource implements SourceInterface | ||
{ | ||
public function getUid(): string | ||
{ | ||
// TODO: Implement getUid() method. | ||
} | ||
|
||
public function setUid(string $uid) | ||
{ | ||
// TODO: Implement setUid() method. | ||
} | ||
|
||
public function setData(string $key, $value = null) | ||
{ | ||
// TODO: Implement setData() method. | ||
} | ||
|
||
public function setDataFromArray(array $data) | ||
{ | ||
// TODO: Implement setDataFromArray() method. | ||
} | ||
|
||
public function getData(string $key = null, $default = null) | ||
{ | ||
// TODO: Implement getData() method. | ||
} | ||
|
||
public function hasData(string $key): bool | ||
{ | ||
// TODO: Implement hasData() method. | ||
} | ||
|
||
public function getRawContent(): string | ||
{ | ||
// TODO: Implement getRawContent() method. | ||
} | ||
|
||
public function setRenderedContent(string $content) | ||
{ | ||
// TODO: Implement setRenderedContent() method. | ||
} | ||
|
||
public function getRenderedContent(): string | ||
{ | ||
// TODO: Implement getRenderedContent() method. | ||
} | ||
|
||
public function getPermalink(): Permalink | ||
{ | ||
// TODO: Implement getPermalink() method. | ||
} | ||
|
||
public function getCompiledPermalink(): string | ||
{ | ||
// TODO: Implement getCompiledPermalink() method. | ||
} | ||
|
||
public function setOverloaded(string $key, $value) | ||
{ | ||
// TODO: Implement setOverloaded() method. | ||
} | ||
|
||
public function getFilename(bool $overloaded = true): string | ||
{ | ||
// TODO: Implement getFilename() method. | ||
} | ||
|
||
public function getExtension(bool $overloaded = true): string | ||
{ | ||
// TODO: Implement getExtension() method. | ||
} | ||
|
||
public function hasChanged(): bool | ||
{ | ||
// TODO: Implement hasChanged() method. | ||
} | ||
|
||
public function setHasChanged(bool $value = true) | ||
{ | ||
// TODO: Implement setHasChanged() method. | ||
} | ||
|
||
public function isRendered(): bool | ||
{ | ||
// TODO: Implement isRendered() method. | ||
} | ||
|
||
public function setRendered(bool $value = true) | ||
{ | ||
// TODO: Implement setRendered() method. | ||
} | ||
|
||
public function isToCopy(): bool | ||
{ | ||
// TODO: Implement isToCopy() method. | ||
} | ||
|
||
public function setToCopy(bool $value = true) | ||
{ | ||
// TODO: Implement setToCopy() method. | ||
} | ||
|
||
public function isIgnored(): bool | ||
{ | ||
// TODO: Implement isIgnored() method. | ||
} | ||
|
||
public function setIgnored(bool $value = true) | ||
{ | ||
// TODO: Implement setIgnored() method. | ||
} | ||
} |