for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace DNADesign\Elemental\Extensions;
use DNADesign\Elemental\Models\ElementalArea;
use SilverStripe\ORM\DataExtension;
/**
* The SiteTreeExtension provides a consistent API surface for reading elements from pages regardless
* of whether the specific implementation of SiteTree (subclass) has the elemental extension applied.
*/
class SiteTreeExtension extends DataExtension
{
* Returns the owner's `ElementalArea()` contents if it has the extension
*
* @return ElementalArea|null
public function ElementArea()
if ($this->owner->hasExtension(ElementalPageExtension::class)) {
return $this->owner->ElementalArea();
}