You are here

trait LayoutCanvasAwareTrait in TMGMT Translator Smartling 8.4

Hierarchy

File

modules/tmgmt_smartling_acquia_cohesion/src/LayoutCanvasAwareTrait.php, line 7

Namespace

Drupal\tmgmt_smartling_acquia_cohesion
View source
trait LayoutCanvasAwareTrait {

  /**
   * @param $json
   * @return bool|LayoutCanvas
   */
  public function isLayoutCanvas($json) {
    if (preg_match('/^\\{"canvas":\\[(.*)\\}$/', $json) !== 1 || empty(json_decode((string) $json))) {
      return false;
    }
    return new LayoutCanvas($json);
  }

}

Members