. */ /** * Proposals_sentences object. * New sentence data is stored in the inhereted fields of CIA * */ require_once(FILESYSTEMROOTPATH."include/model/AbstractMySQL.php"); require_once("CIA.php"); class Proposals_sentences extends CIA { /** id */ private $id; /** proposal_id */ private $proposal_id; /** change_type */ private $change_type; // edit|new|del /** sentence_id */ private $sentence_id; /** jc_comment */ private $jc_comment; private $title_status; private $title2_status; private $article_title_status; private $paragraph_status; /* constructor 1*/ public function __construct($data) { parent::__construct($data); if( is_array($data) ) { $this->id = $data['id']; $this->proposal_id = $data['proposal_id']; $this->change_type = $data['change_type']; $this->sentence_id = $data['sentence_id']; $this->jc_comment = $data['jc_comment']; $this->title_status = $data['title_status']; $this->title2_status = $data['title2_status']; $this->article_title_status = $data['article_title_status']; $this->paragraph_status = $data['paragraph_status']; } else { $this->id= ''; $this->proposal_id = ''; $this->change_type = ''; $this->sentence_id = ''; $this->jc_comment = ''; $this->title_status = ''; $this->title2_status = ''; $this->article_title_status = ''; $this->paragraph_status = ''; } } public function copy(Proposals_sentences $ps) { $this->setId($ps->getId()); $this->setProposal_id($ps->getProposal_id()); $this->setChange_type($ps->getChange_type()); $this->setJc_comment($ps->getJc_comment()); $this->setSentence_id($ps->getSentence_id()); $this->setCategory($ps->getCategory()); $this->setTitle($ps->getTitle()); $this->setOrder($ps->getOrder()); $this->setLast_change($ps->getLast_change()); $this->setTitle2($ps->getTitle2()); $this->setOrder2($ps->getOrder2()); $this->setArticle($ps->getArticle()); $this->setArticle_title($ps->getArticle_title()); $this->setParagraph($ps->getParagraph()); $this->setSentence($ps->getSentence()); $this->setSentence_text($ps->getSentence_text()); $this->setAgora_id_start($ps->getAgora_id_start()); $this->setAgora_id_end($ps->getAgora_id_end()); $this->setTitle_status($ps->getTitle_status()); $this->setTitle2_status($ps->getTitle2_status()); $this->setArticle_title_status($ps->getarticle_title_status()); $this->setParagraph_status($ps->getParagraph_status()); } public function copy_from_cia(CIA $cia) { $this->setSentence_id($cia->getId()); $this->setCategory($cia->getCategory()); $this->setTitle($cia->getTitle()); $this->setOrder($cia->getOrder()); $this->setLast_change($cia->getLast_change()); $this->setTitle2($cia->getTitle2()); $this->setOrder2($cia->getOrder2()); $this->setArticle($cia->getArticle()); $this->setArticle_title($cia->getArticle_title()); $this->setParagraph($cia->getParagraph()); $this->setSentence($cia->getSentence()); $this->setSentence_text($cia->getSentence_text()); $this->setAgora_id_start($cia->getAgora_id_start()); $this->setAgora_id_end($cia->getAgora_id_end()); } public function copy_from_cia_array($cia) { $this->setSentence_id($cia['id']); $this->setCategory($cia['category']); $this->setTitle($cia['title']); $this->setOrder($cia['order']); $this->setLast_change($cia['last_change']); $this->setTitle2($cia['title2']); $this->setOrder2($cia['order2']); $this->setArticle($cia['article']); $this->setArticle_title($cia['article_title']); $this->setParagraph($cia['paragraph']); $this->setSentence($cia['sentence']); $this->setSentence_text($cia['sentence_text']); $this->setAgora_id_start($cia['agora_id_start']); $this->setAgora_id_end( $cia['agora_id_end']); } public function ismodified(CIA $cia){ $check = array('getTitle','getOrder','getTitle2','getOrder2','getArticle', 'getArticle_title','getParagraph','getSentence','getSentence_text'); foreach($check as $c){ if ($this->$c() != $cia->$c()){ return true; } } return false; } public function modifiedHeader(CIA $cia){ $check = array('getTitle','getOrder','getTitle2','getOrder2','getArticle', 'getArticle_title','getParagraph'); foreach($check as $c){ if ($this->$c() != $cia->$c()){ return true; } } return false; } public function getId() { return $this->id; } public function setId($id) { $this->id = $id; } public function getProposal_id() { return $this->proposal_id; } public function setProposal_id($proposal_id) { $this->proposal_id = $proposal_id; } public function getChange_type() { return $this->change_type; } public function setChange_type($change_type) { $this->change_type = $change_type; } public function getSentence_id() { return $this->sentence_id; } public function setSentence_id($sentence_id) { $this->sentence_id = $sentence_id; } public function getJc_comment() { return $this->jc_comment; } public function setJc_comment($jc_comment) { $this->jc_comment = $jc_comment; } public function getTitle_status() { return $this->title_status; } public function setTitle_status($title_status) { $this->title_status = $title_status; } public function getTitle2_status() { return $this->title2_status; } public function setTitle2_status($title2_status) { $this->title2_status = $title2_status; } public function getArticle_title_status() { return $this->article_title_status; } public function setArticle_title_status($article_title_status) { $this->article_title_status = $article_title_status; } public function getParagraph_status() { return $this->paragraph_status; } public function setParagraph_status($paragraph_status) { $this->paragraph_status = $paragraph_status; } } ?>