diff --git a/module/Application/src/Model/CoreEntityModel.php b/module/Application/src/Model/CoreEntityModel.php index 032de35..d508550 100644 --- a/module/Application/src/Model/CoreEntityModel.php +++ b/module/Application/src/Model/CoreEntityModel.php @@ -53,6 +53,14 @@ class CoreEntityModel { */ protected $sSingleForm; + public $created_by; + + public $created_date; + + public $modified_by; + + public $modified_date; + /** * CoreEntityModel constructor. * @param AdapterInterface $oDbAdapter @@ -256,6 +264,7 @@ protected function attachDynamicFields() { case 'text': case 'textarea': case 'email': + case 'featuredimage': case 'tel': $this->$sFieldName = ''; break; @@ -289,4 +298,18 @@ protected function updateDynamicFields(array $aData) { } } } + + /** + * Checks if Entity has featured image + * + * @return bool true if has, false otherwise + * @since 1.0.5 + */ + public function hasFeaturedImage() { + if(property_exists($this,'featured_image')) { + return true; + } else { + return false; + } + } } \ No newline at end of file diff --git a/module/Application/src/Model/CoreEntityTable.php b/module/Application/src/Model/CoreEntityTable.php index 23cf340..6436148 100644 --- a/module/Application/src/Model/CoreEntityTable.php +++ b/module/Application/src/Model/CoreEntityTable.php @@ -92,4 +92,8 @@ protected function attachDynamicFields(array $aData,$oObject) { return $aData; } + + public function updateAttribute($sAttribute,$sVal,$sIDKey,$iEntityID) { + $this->oTableGateway->update([$sAttribute=>$sVal],[$sIDKey=>$iEntityID]); + } } \ No newline at end of file diff --git a/module/Application/view/partial/viewform.phtml b/module/Application/view/partial/viewform.phtml index 0b0f92a..7decc7c 100644 --- a/module/Application/view/partial/viewform.phtml +++ b/module/Application/view/partial/viewform.phtml @@ -3,11 +3,22 @@