File indexing completed on 2024-12-15 05:21:36

0001 <?php
0002 /**
0003  *  ocs-apiserver
0004  *
0005  *  Copyright 2016 by pling GmbH.
0006  *
0007  *    This file is part of ocs-apiserver.
0008  *
0009  *    This program is free software: you can redistribute it and/or modify
0010  *    it under the terms of the GNU Affero General Public License as
0011  *    published by the Free Software Foundation, either version 3 of the
0012  *    License, or (at your option) any later version.
0013  *
0014  *    This program is distributed in the hope that it will be useful,
0015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017  *    GNU Affero General Public License for more details.
0018  *
0019  *    You should have received a copy of the GNU Affero General Public License
0020  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021  **/
0022 class Application_Model_DbRow_Project extends Zend_Db_Table_Row_Abstract implements Local_Db_Table_Row_ValidateInterface
0023 {
0024     const CATEGORY_DEFAULT_PROJECT = 0;
0025     const STATUS_PROJECT_ACTIVE = 10;
0026     const DEFAULT_AVATAR_IMAGE = 'std_avatar_80.png';
0027     const PERSONAL_PROJECT_TITLE = 'Personal Page';
0028 
0029     protected $_data = array(
0030         'id' => null,
0031         'owner' => null,
0032         'category' => null,
0033         'title' => '',
0034         'amount_received' => 0,
0035         'collectAmount' => 0,
0036         'collectPlings' => 0,
0037         'collectPlingsSum' => 0,
0038         'description' => '',
0039         'created_date' => null,
0040         'changed_date' => null,
0041         'deleted_date' => null,
0042         'image_big' => '',
0043         'image_small' => '',
0044         'status' => 0,
0045         'visits' => 0,
0046         'facebook' => '',
0047         'type_id' => 1,
0048         'amount' => null
0049     );
0050 
0051     public function getCatTitle()
0052     {
0053         return $this->_data['category']->title;
0054     }
0055 
0056     /**
0057      * @param boolean $status
0058      * @return mixed
0059      */
0060     public function setVerifiedStatus($status)
0061     {
0062         $this->validated = (int)$status;
0063         $this->validated_at = new Zend_Db_Expr('NOW()');
0064         if (false === $this->isConnected()) {
0065             $this->setTable(new Application_Model_DbTable_Project());
0066         }
0067         return parent::save();
0068     }
0069 
0070 }
0071