CyberDuck\Searchly\DataObject\PrimitiveDataObject
Creates a stdClass representation of a DataObject populated with fields and its relations.
- Author: Andrew Mc Cormack <andy@cyber-duck.co.uk>
- Copyright: Copyright (c) 2018, Andrew Mc Cormack
- License: https://github.com/cyber-duck/silverstripe-searchly/license
Synopsis
class PrimitiveDataObject
{
- // members
- protected DataObject $source;
- protected DataObjectSchema $schema;
- protected DataObjectHierarchy $hierarchy;
- protected stdClass $data;
- protected array $ignoreRelations = ;
- protected array $UserDefinedForm = ;
- // methods
- public void __construct()
- public PrimitiveDataObject setIgnoreRelation()
- public PrimitiveDataObject setIgnoreClass()
- public stdClass getData()
- protected boolean hasLink()
- protected string|null getLink()
- protected int getSubsiteID()
- protected void setColumnContent()
- private void setRelation()
- private Closure getHasOneMethod()
- private Closure getHasManyMethod()
- private Closure getManyManyMethod()
Members
protected
- $UserDefinedForm
—
array
Ignores these classes when building the search schema. - $data
—
stdClass
Constructed model schema data instance. - $hierarchy
—
CyberDuck\Searchly\DataObject\DataObjectHierarchy
DataObjectHierarchy instance. - $ignoreRelations
—
array
Ignores these relations when building the search schema. - $schema
—
SilverStripe\ORM\DataObjectSchema
DataObject schema instance. - $source
—
SilverStripe\ORM\DataObject
Source model instance.
Methods
private
- getHasManyMethod() — Returns the has many relation closure to execute and build the relation.
- getHasOneMethod() — Returns the has one relation closure to execute and build the relation.
- getManyManyMethod() — Returns the many many relation closure to execute and build the relation.
- setRelation() — Sets a has one, has many, or many many relation by validating the passed values and running the relation specific closure.
protected
- getLink() — Returns the Link property.
- getSubsiteID() — Returns the record subsite ID.
- hasLink() — Checks if a link exists on the source DataObject.
- setColumnContent() — Normalises HTML field content.
public
- __construct() — Sets the required instances.
- getData() — Returns the constructed data instance.
- setIgnoreClass() — Sets a class name to ignore when building the schema.
- setIgnoreRelation() — Sets a relation name to ignore when building the schema.