Thread.php
00001 <?php
00012 class Dsao_Model_Scroll_Thread extends Dsao_Model_Scroll_Abstract
00013 {
00024 public function fetchThread($idThread, $idUser = 0)
00025 {
00026
00027 $thread = new Dsao_Scrollset();
00028
00029
00030 if(!$this->isParticipated($idUser, $idThread))
00031 {
00032 return $thread;
00033 }
00034
00035
00036 $sqlWhere = array
00037 (
00038 '`scroll_header`.id = ? OR idThread = ?' => $idThread
00039 );
00040
00041
00042 if ($idUser)
00043 {
00044 $sqlWhere['(idAuthor = ? AND deleted != 1) OR (idRecipient = ? AND deleted != 2)']
00045 = $idUser;
00046 }
00047
00048
00049 $thread->fetchScrolls($sqlWhere);
00050
00051 return $thread;
00052 }
00053 }