QueryResult.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2004-2008 by Konstantin V. Arkhipov                     *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation; either version 3 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00017     final class QueryResult implements Identifiable
00018     {
00019         private $list       = array();
00020         
00021         private $count      = 0;
00022         private $affected   = 0;
00023         
00024         private $query      = null;
00025         
00029         public static function create()
00030         {
00031             return new self;
00032         }
00033         
00034         public function getId()
00035         {
00036             return '_result_'.$this->query->getId();
00037         }
00038         
00039         public function setId($id)
00040         {
00041             throw new UnsupportedMethodException();
00042         }
00043         
00047         public function getQuery()
00048         {
00049             return $this->query;
00050         }
00051         
00055         public function setQuery(SelectQuery $query)
00056         {
00057             $this->query = $query;
00058             
00059             return $this;
00060         }
00061         
00062         public function getList()
00063         {
00064             return $this->list;
00065         }
00066         
00070         public function setList($list)
00071         {
00072             $this->list = $list;
00073             
00074             return $this;
00075         }
00076         
00077         public function getCount()
00078         {
00079             return $this->count;
00080         }
00081         
00085         public function setCount($count)
00086         {
00087             $this->count = $count;
00088             
00089             return $this;
00090         }
00091         
00092         public function getAffected()
00093         {
00094             return $this->affected;
00095         }
00096         
00100         public function setAffected($affected)
00101         {
00102             $this->affected = $affected;
00103             
00104             return $this;
00105         }
00106     }
00107 ?>