-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2d0d4c
commit 3155594
Showing
17 changed files
with
281 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
modules/template/elements/BaseTemplateElementContentDefinition.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
/** | ||
* @link https://www.humhub.org/ | ||
* @copyright Copyright (c) HumHub GmbH & Co. KG | ||
* @license https://www.humhub.com/licences | ||
*/ | ||
|
||
namespace humhub\modules\custom_pages\modules\template\elements; | ||
|
||
use humhub\modules\custom_pages\modules\template\components\ActiveRecordDynamicAttributes; | ||
|
||
/** | ||
* Class for template element content definition | ||
* | ||
* @property bool $is_default | ||
*/ | ||
abstract class BaseTemplateElementContentDefinition extends ActiveRecordDynamicAttributes | ||
{ | ||
private $formName; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public static function tableName() | ||
{ | ||
return 'custom_pages_template_element_content_definition'; | ||
} | ||
|
||
public function setFormName($formName): void | ||
{ | ||
$this->formName = $formName; | ||
} | ||
|
||
public function hasValues(): bool | ||
{ | ||
foreach ($this->attributes() as $key) { | ||
if ($this->getAttribute($key) !== null && $key !== 'id' && $key !== 'is_default') { | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function formName() | ||
{ | ||
return $this->formName ?? parent::formName(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.