1234567891011121314151617181920212223242526272829303132 |
- <?php namespace Kanboard\Plugin\OMIProjectBranding\Model;
- use Kanboard\Core\Base;
- /**
- * ProjectBrandingModel Model
- *
- * @author Dwayne @ OMI NZ
- */
- class ProjectBrandingModel extends Base {
-
- const TABLE = "project_branding";
-
- public function getBrandingByProjectId($projectId) {
- return $this->db->table(self::TABLE)
- ->eq("project_id", $projectId)
- ->findOne();
- }
-
- public function saveBranding(array $branding) {
- $brandingRecord = $this->getBrandingByProjectId($branding["project_id"]);
-
- if ($brandingRecord) {
- return $this->db->table(self::TABLE)
- ->eq("project_id", $branding["project_id"])
- ->update($branding);
- }
-
- return $this->db->table(self::TABLE)->insert($branding);
- }
- }
- #-
- #plugins/OMIProjectBranding/Model/ProjectBrandingModel.php
|