6 * Helper class for defining entity examples.
8 * By convention, you should name this class relative to the target workflow,
11 * - Entity Name: ContributionRecur
12 * - Example Data: Civi\Test\ExampleData\ContributionRecur\Euro5990
13 * - Example Name: entity/ContributionRecur/Euro5900
15 abstract class EntityExample
implements ExampleDataInterface
{
20 protected $entityName;
27 public function __construct() {
28 if (!preg_match(';^(.*)[_\\\]([a-zA-Z0-9]+)[_\\\]([a-zA-Z0-9]+)$;', static::class, $m)) {
29 throw new \
RuntimeException("Failed to parse class: " . static::class);
31 $this->entityName
= $m[2];
32 $this->exName
= $m[3];
35 protected function dao(): string {
36 return \CRM_Core_DAO_AllCoreTables
::getFullName($this->entityName
);
39 protected function bao(): string {
40 return \CRM_Core_DAO_AllCoreTables
::getBAOClassName($this->getDAO());