Afform - delete unused, nonfunctional apis
authorColeman Watts <coleman@civicrm.org>
Thu, 21 Jan 2021 22:57:18 +0000 (17:57 -0500)
committerColeman Watts <coleman@civicrm.org>
Thu, 21 Jan 2021 22:57:18 +0000 (17:57 -0500)
ext/afform/core/Civi/Api4/AfformPalette.php [deleted file]
ext/afform/core/Civi/Api4/AfformTag.php [deleted file]
ext/afform/mock/tests/phpunit/api/v4/AfformPaletteTest.php [deleted file]

diff --git a/ext/afform/core/Civi/Api4/AfformPalette.php b/ext/afform/core/Civi/Api4/AfformPalette.php
deleted file mode 100644 (file)
index e803aa0..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-namespace Civi\Api4;
-
-/**
- * Class AfformPalette
- * @searchable false
- * @package Civi\Api4
- */
-class AfformPalette extends Generic\AbstractEntity {
-
-  /**
-   * @param bool $checkPermissions
-   * @return Generic\BasicGetAction
-   */
-  public static function get($checkPermissions = TRUE) {
-    return (new Generic\BasicGetAction('AfformPalette', __FUNCTION__, function() {
-      return [
-        [
-          'id' => 'Parent:afl-name',
-          'entity' => 'Parent',
-          'title' => 'Name',
-          'template' => '<afl-name contact-id="entities.parent.id" afl-label="Name"/>',
-        ],
-        [
-          'id' => 'Parent:afl-address',
-          'entity' => 'Parent',
-          'title' => 'Address',
-          'template' => '<afl-address contact-id="entities.parent.id" afl-label="Address"/>',
-        ],
-      ];
-    }))->setCheckPermissions($checkPermissions);
-  }
-
-  /**
-   * @param bool $checkPermissions
-   * @return Generic\BasicGetFieldsAction
-   */
-  public static function getFields($checkPermissions = TRUE) {
-    return (new Generic\BasicGetFieldsAction('AfformPalette', __FUNCTION__, function() {
-      return [
-        [
-          'name' => 'id',
-        ],
-        [
-          'name' => 'entity',
-        ],
-        [
-          'name' => 'title',
-        ],
-        [
-          'name' => 'template',
-        ],
-      ];
-    }))->setCheckPermissions($checkPermissions);
-  }
-
-  /**
-   * @return array
-   */
-  public static function permissions() {
-    return [
-      "meta" => ["access CiviCRM"],
-      "default" => ["administer CiviCRM"],
-    ];
-  }
-
-}
diff --git a/ext/afform/core/Civi/Api4/AfformTag.php b/ext/afform/core/Civi/Api4/AfformTag.php
deleted file mode 100644 (file)
index e2ca67f..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-namespace Civi\Api4;
-
-/**
- * Class AfformTag
- * @searchable false
- * @package Civi\Api4
- */
-class AfformTag extends Generic\AbstractEntity {
-
-  /**
-   * @param bool $checkPermissions
-   * @return Generic\BasicGetAction
-   */
-  public static function get($checkPermissions = TRUE) {
-    return (new Generic\BasicGetAction('AfformTag', __FUNCTION__, function() {
-      return [
-        [
-          'name' => 'afl-entity',
-          'attrs' => ['entity-name', 'matching-rule', 'assigned-values'],
-        ],
-        [
-          'name' => 'afl-name',
-          'attrs' => ['contact-id', 'afl-label'],
-        ],
-        [
-          'name' => 'afl-contact-email',
-          'attrs' => ['contact-id', 'afl-label'],
-        ],
-      ];
-    }))->setCheckPermissions($checkPermissions);
-  }
-
-  /**
-   * @param bool $checkPermissions
-   * @return Generic\BasicGetFieldsAction
-   */
-  public static function getFields($checkPermissions = TRUE) {
-    return (new Generic\BasicGetFieldsAction('AfformTag', __FUNCTION__, function() {
-      return [
-        [
-          'name' => 'name',
-        ],
-        [
-          'name' => 'attrs',
-        ],
-      ];
-    }))->setCheckPermissions($checkPermissions);
-  }
-
-  /**
-   * @return array
-   */
-  public static function permissions() {
-    return [
-      "meta" => ["access CiviCRM"],
-      "default" => ["administer CiviCRM"],
-    ];
-  }
-
-}
diff --git a/ext/afform/mock/tests/phpunit/api/v4/AfformPaletteTest.php b/ext/afform/mock/tests/phpunit/api/v4/AfformPaletteTest.php
deleted file mode 100644 (file)
index 7f2ec85..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
- * AfformPalette API Test
- * @group headless
- */
-class api_v4_AfformPaletteTest extends api_v4_AfformTestCase {
-
-  public function testGetPalette() {
-    $r = Civi\Api4\AfformPalette::get()
-      ->addWhere('id', '=', 'Parent:afl-name')
-      ->execute();
-    $this->assertEquals(1, $r->count());
-
-    $r = Civi\Api4\AfformPalette::get()
-      ->setLimit(10)
-      ->execute();
-    $this->assertTrue($r->count() > 1);
-  }
-
-}