@@ -116,6 +116,7 @@ |
||
| 116 | 116 | /** |
| 117 | 117 | * @param object handler to method calls. |
| 118 | 118 | * @param object the object to by proxied. |
| 119 | + * @param TLazyLoadList $handler |
|
| 119 | 120 | */ |
| 120 | 121 | public function __construct($handler, $object) |
| 121 | 122 | { |
@@ -30,8 +30,8 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function __construct($handler, $object) |
| 32 | 32 | { |
| 33 | - $this->_handler = $handler; |
|
| 34 | - $this->_object = $object; |
|
| 33 | + $this->_handler=$handler; |
|
| 34 | + $this->_object=$object; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -205,6 +205,9 @@ |
||
| 205 | 205 | return $keyList; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | + /** |
|
| 209 | + * @param TList $keyList |
|
| 210 | + */ |
|
| 208 | 211 | protected function setKeyList($keyList) |
| 209 | 212 | { |
| 210 | 213 | $this->getCache()->set($this->getKeyListId(), $keyList); |
@@ -32,9 +32,9 @@ discard block |
||
| 32 | 32 | * Create a new cache with limited cache size. |
| 33 | 33 | * @param TSqlMapCacheModel $cacheModel. |
| 34 | 34 | */ |
| 35 | - public function __construct($cacheModel = null) |
|
| 35 | + public function __construct($cacheModel=null) |
|
| 36 | 36 | { |
| 37 | - $this->_cacheModel = $cacheModel; |
|
| 37 | + $this->_cacheModel=$cacheModel; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | protected function getKeyListId() |
| 45 | 45 | { |
| 46 | - $id = 'keyList'; |
|
| 47 | - if ($this->_cacheModel instanceof TSqlMapCacheModel) |
|
| 48 | - $id .= '_' . $this->_cacheModel->getId(); |
|
| 46 | + $id='keyList'; |
|
| 47 | + if($this->_cacheModel instanceof TSqlMapCacheModel) |
|
| 48 | + $id.='_'.$this->_cacheModel->getId(); |
|
| 49 | 49 | return $id; |
| 50 | 50 | } |
| 51 | 51 | /** |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | protected function getKeyList() |
| 56 | 56 | { |
| 57 | - if (($keyList = $this->getCache()->get($this->getKeyListId())) === false) |
|
| 57 | + if(($keyList=$this->getCache()->get($this->getKeyListId()))===false) |
|
| 58 | 58 | { |
| 59 | - $keyList = new TList(); |
|
| 59 | + $keyList=new TList(); |
|
| 60 | 60 | $this->getCache()->set($this->getKeyListId(), $keyList); |
| 61 | 61 | } |
| 62 | 62 | return $keyList; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function delete($key) |
| 74 | 74 | { |
| 75 | - $keyList = $this->getKeyList(); |
|
| 75 | + $keyList=$this->getKeyList(); |
|
| 76 | 76 | $keyList->remove($key); |
| 77 | 77 | $this->getCache()->delete($key); |
| 78 | 78 | $this->setKeyList($keyList); |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function flush() |
| 85 | 85 | { |
| 86 | - $keyList = $this->getKeyList(); |
|
| 87 | - $cache = $this->getCache(); |
|
| 88 | - foreach ($keyList as $key) |
|
| 86 | + $keyList=$this->getKeyList(); |
|
| 87 | + $cache=$this->getCache(); |
|
| 88 | + foreach($keyList as $key) |
|
| 89 | 89 | { |
| 90 | 90 | $cache->delete($key); |
| 91 | 91 | } |
@@ -98,18 +98,18 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function get($key) |
| 100 | 100 | { |
| 101 | - $result = $this->getCache()->get($key); |
|
| 102 | - if ($result === false) |
|
| 101 | + $result=$this->getCache()->get($key); |
|
| 102 | + if($result===false) |
|
| 103 | 103 | { |
| 104 | 104 | // if the key has not been found in cache (e.g expired), remove from keylist |
| 105 | - $keyList = $this->getKeyList(); |
|
| 106 | - if ($keyList->contains($key)) |
|
| 105 | + $keyList=$this->getKeyList(); |
|
| 106 | + if($keyList->contains($key)) |
|
| 107 | 107 | { |
| 108 | 108 | $keyList->remove($key); |
| 109 | 109 | $this->setKeyList($keyList); |
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | - return $result === false ? null : $result; |
|
| 112 | + return $result===false ? null : $result; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
@@ -117,11 +117,11 @@ discard block |
||
| 117 | 117 | * @param string the key identifying the value to be cached |
| 118 | 118 | * @param mixed the value to be cached |
| 119 | 119 | */ |
| 120 | - public function set($key, $value, $expire = 0, $dependency = null) |
|
| 120 | + public function set($key, $value, $expire=0, $dependency=null) |
|
| 121 | 121 | { |
| 122 | 122 | $this->getCache()->set($key, $value, $expire, $dependency); |
| 123 | - $keyList = $this->getKeyList(); |
|
| 124 | - if (!$keyList->contains($key)) |
|
| 123 | + $keyList=$this->getKeyList(); |
|
| 124 | + if(!$keyList->contains($key)) |
|
| 125 | 125 | { |
| 126 | 126 | $keyList->add($key); |
| 127 | 127 | $this->setKeyList($keyList); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | /** |
| 140 | 140 | * @throws TSqlMapException not implemented. |
| 141 | 141 | */ |
| 142 | - public function add($id, $value, $expire = 0, $dependency = null) |
|
| 142 | + public function add($id, $value, $expire=0, $dependency=null) |
|
| 143 | 143 | { |
| 144 | 144 | throw new TSqlMapException('sqlmap_use_set_to_store_cache'); |
| 145 | 145 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | public function getID(); |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * @return TSqlMapStatement The SQL statment used by this TMappedStatement. |
|
| 26 | + * @return \Prado\Data\SqlMap\Configuration\TSqlMapStatement The SQL statment used by this TMappedStatement. |
|
| 27 | 27 | */ |
| 28 | 28 | public function getStatement(); |
| 29 | 29 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * @param string The property of the result object to be used as the value (or null) |
| 45 | 45 | * @return TMap A map of object containing the rows keyed by <tt>$keyProperty</tt>. |
| 46 | 46 | */ |
| 47 | - public function executeQueryForMap($connection, $parameter, $keyProperty, $valueProperty = null); |
|
| 47 | + public function executeQueryForMap($connection, $parameter, $keyProperty, $valueProperty=null); |
|
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * @param integer The maximum number of rows to return. |
| 67 | 67 | * @return TList A TList of result objects. |
| 68 | 68 | */ |
| 69 | - public function executeQueryForList($connection, $parameter, $result = null, $skip = -1, $max = -1); |
|
| 69 | + public function executeQueryForList($connection, $parameter, $result=null, $skip=-1, $max=-1); |
|
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -77,6 +77,6 @@ discard block |
||
| 77 | 77 | * @param object The result object. |
| 78 | 78 | * @return object result. |
| 79 | 79 | */ |
| 80 | - public function executeQueryForObject($connection, $parameter, $result = null); |
|
| 80 | + public function executeQueryForObject($connection, $parameter, $result=null); |
|
| 81 | 81 | } |
| 82 | 82 | |
@@ -39,5 +39,9 @@ |
||
| 39 | 39 | public function setKeys($value){ $this->_keys = $value; } |
| 40 | 40 | |
| 41 | 41 | public function getMethod(){ return $this->_method; } |
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * @param integer $value |
|
| 45 | + */ |
|
| 42 | 46 | public function setMethod($value){ $this->_method = $value; } |
| 43 | 47 | } |
| 44 | 48 | \ No newline at end of file |
@@ -24,20 +24,20 @@ |
||
| 24 | 24 | private $_property; |
| 25 | 25 | private $_resultObject; |
| 26 | 26 | private $_keys; |
| 27 | - private $_method = TMappedStatement::QUERY_FOR_LIST; |
|
| 27 | + private $_method=TMappedStatement::QUERY_FOR_LIST; |
|
| 28 | 28 | |
| 29 | - public function getStatement(){ return $this->_statement; } |
|
| 30 | - public function setStatement($value){ $this->_statement = $value; } |
|
| 29 | + public function getStatement() { return $this->_statement; } |
|
| 30 | + public function setStatement($value) { $this->_statement=$value; } |
|
| 31 | 31 | |
| 32 | - public function getResultProperty(){ return $this->_property; } |
|
| 33 | - public function setResultProperty($value){ $this->_property = $value; } |
|
| 32 | + public function getResultProperty() { return $this->_property; } |
|
| 33 | + public function setResultProperty($value) { $this->_property=$value; } |
|
| 34 | 34 | |
| 35 | - public function getResultObject(){ return $this->_resultObject; } |
|
| 36 | - public function setResultObject($value){ $this->_resultObject = $value; } |
|
| 35 | + public function getResultObject() { return $this->_resultObject; } |
|
| 36 | + public function setResultObject($value) { $this->_resultObject=$value; } |
|
| 37 | 37 | |
| 38 | - public function getKeys(){ return $this->_keys; } |
|
| 39 | - public function setKeys($value){ $this->_keys = $value; } |
|
| 38 | + public function getKeys() { return $this->_keys; } |
|
| 39 | + public function setKeys($value) { $this->_keys=$value; } |
|
| 40 | 40 | |
| 41 | - public function getMethod(){ return $this->_method; } |
|
| 42 | - public function setMethod($value){ $this->_method = $value; } |
|
| 41 | + public function getMethod() { return $this->_method; } |
|
| 42 | + public function setMethod($value) { $this->_method=$value; } |
|
| 43 | 43 | } |
| 44 | 44 | \ No newline at end of file |
@@ -24,6 +24,9 @@ |
||
| 24 | 24 | private $_parameterObject; |
| 25 | 25 | private $_list; |
| 26 | 26 | |
| 27 | + /** |
|
| 28 | + * @param \ArrayAccess $list |
|
| 29 | + */ |
|
| 27 | 30 | public function __construct($result, $parameter, &$list) |
| 28 | 31 | { |
| 29 | 32 | $this->_resultObject = $result; |
@@ -26,9 +26,9 @@ |
||
| 26 | 26 | |
| 27 | 27 | public function __construct($result, $parameter, &$list) |
| 28 | 28 | { |
| 29 | - $this->_resultObject = $result; |
|
| 30 | - $this->_parameterObject = $parameter; |
|
| 31 | - $this->_list = &$list; |
|
| 29 | + $this->_resultObject=$result; |
|
| 30 | + $this->_parameterObject=$parameter; |
|
| 31 | + $this->_list=&$list; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function getResult() |
@@ -67,7 +67,8 @@ discard block |
||
| 67 | 67 | /** |
| 68 | 68 | * Creates the DB connection. |
| 69 | 69 | * @param string the module ID for TDataSourceConfig |
| 70 | - * @return TDbConnection the created DB connection |
|
| 70 | + * @param string $connectionID |
|
| 71 | + * @return \Prado\Data\TDbConnection the created DB connection |
|
| 71 | 72 | * @throws TConfigurationException if module ID is invalid or empty |
| 72 | 73 | */ |
| 73 | 74 | protected function createDbConnection($connectionID) |
@@ -192,6 +193,7 @@ discard block |
||
| 192 | 193 | |
| 193 | 194 | /** |
| 194 | 195 | * Update the catalogue last modified time. |
| 196 | + * @param string $variant |
|
| 195 | 197 | * @return boolean true if updated, false otherwise. |
| 196 | 198 | */ |
| 197 | 199 | private function updateCatalogueTime($cat_id, $variant) |
@@ -74,8 +74,7 @@ |
||
| 74 | 74 | return $conn->getDbConnection(); |
| 75 | 75 | else |
| 76 | 76 | throw new TConfigurationException('messagesource_connectionid_invalid', $connectionID); |
| 77 | - } |
|
| 78 | - else |
|
| 77 | + } else |
|
| 79 | 78 | throw new TConfigurationException('messagesource_connectionid_required'); |
| 80 | 79 | } |
| 81 | 80 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | class MessageSource_Database extends MessageSource |
| 34 | 34 | { |
| 35 | - private $_connID = ''; |
|
| 35 | + private $_connID=''; |
|
| 36 | 36 | private $_conn; |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function __construct($source) |
| 45 | 45 | { |
| 46 | - $this->_connID = (string)$source; |
|
| 46 | + $this->_connID=(string) $source; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function getDbConnection() |
| 53 | 53 | { |
| 54 | - if($this->_conn === null) |
|
| 54 | + if($this->_conn===null) |
|
| 55 | 55 | { |
| 56 | - $this->_conn = $this->createDbConnection($this->_connID); |
|
| 56 | + $this->_conn=$this->createDbConnection($this->_connID); |
|
| 57 | 57 | $this->_conn->setActive(true); |
| 58 | 58 | } |
| 59 | 59 | return $this->_conn; |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | protected function createDbConnection($connectionID) |
| 69 | 69 | { |
| 70 | - if($connectionID !== '') |
|
| 70 | + if($connectionID!=='') |
|
| 71 | 71 | { |
| 72 | - $conn = Prado::getApplication()->getModule($connectionID); |
|
| 72 | + $conn=Prado::getApplication()->getModule($connectionID); |
|
| 73 | 73 | if($conn instanceof TDataSourceConfig) |
| 74 | 74 | return $conn->getDbConnection(); |
| 75 | 75 | else |
@@ -87,19 +87,19 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | protected function &loadData($variant) |
| 89 | 89 | { |
| 90 | - $command = $this->getDBConnection()->createCommand( |
|
| 90 | + $command=$this->getDBConnection()->createCommand( |
|
| 91 | 91 | 'SELECT t.id, t.source, t.target, t.comments |
| 92 | 92 | FROM trans_unit t, catalogue c |
| 93 | 93 | WHERE c.cat_id = t.cat_id |
| 94 | 94 | AND c.name = :variant |
| 95 | 95 | ORDER BY id ASC'); |
| 96 | 96 | $command->bindParameter(':variant', $variant, PDO::PARAM_STR); |
| 97 | - $dataReader = $command->query(); |
|
| 97 | + $dataReader=$command->query(); |
|
| 98 | 98 | |
| 99 | - $result = []; |
|
| 99 | + $result=[]; |
|
| 100 | 100 | |
| 101 | - foreach ($dataReader as $row) |
|
| 102 | - $result[$row['source']] = [$row['target'],$row['id'],$row['comments']]; |
|
| 101 | + foreach($dataReader as $row) |
|
| 102 | + $result[$row['source']]=[$row['target'], $row['id'], $row['comments']]; |
|
| 103 | 103 | |
| 104 | 104 | return $result; |
| 105 | 105 | } |
@@ -112,10 +112,10 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | protected function getLastModified($source) |
| 114 | 114 | { |
| 115 | - $command = $this->getDBConnection()->createCommand( |
|
| 115 | + $command=$this->getDBConnection()->createCommand( |
|
| 116 | 116 | 'SELECT date_modified FROM catalogue WHERE name = :source'); |
| 117 | 117 | $command->bindParameter(':source', $source, PDO::PARAM_STR); |
| 118 | - $result = $command->queryScalar(); |
|
| 118 | + $result=$command->queryScalar(); |
|
| 119 | 119 | return $result ? $result : 0; |
| 120 | 120 | } |
| 121 | 121 | |
@@ -128,10 +128,10 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | protected function isValidSource($variant) |
| 130 | 130 | { |
| 131 | - $command = $this->getDBConnection()->createCommand( |
|
| 131 | + $command=$this->getDBConnection()->createCommand( |
|
| 132 | 132 | 'SELECT COUNT(*) FROM catalogue WHERE name = :variant'); |
| 133 | 133 | $command->bindParameter(':variant', $variant, PDO::PARAM_STR); |
| 134 | - return $command->queryScalar() == 1; |
|
| 134 | + return $command->queryScalar()==1; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -141,18 +141,18 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | protected function getCatalogueList($catalogue) |
| 143 | 143 | { |
| 144 | - $variants = explode('_', $this->culture); |
|
| 144 | + $variants=explode('_', $this->culture); |
|
| 145 | 145 | |
| 146 | - $catalogues = [$catalogue]; |
|
| 146 | + $catalogues=[$catalogue]; |
|
| 147 | 147 | |
| 148 | - $variant = null; |
|
| 148 | + $variant=null; |
|
| 149 | 149 | |
| 150 | - for($i = 0, $k = count($variants); $i < $k; ++$i) |
|
| 150 | + for($i=0, $k=count($variants); $i < $k; ++$i) |
|
| 151 | 151 | { |
| 152 | 152 | if(isset($variants[$i]{0})) |
| 153 | 153 | { |
| 154 | - $variant .= ($variant)?'_' . $variants[$i]:$variants[$i]; |
|
| 155 | - $catalogues[] = $catalogue . '.' . $variant; |
|
| 154 | + $variant.=($variant) ? '_'.$variants[$i] : $variants[$i]; |
|
| 155 | + $catalogues[]=$catalogue.'.'.$variant; |
|
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | return array_reverse($catalogues); |
@@ -163,24 +163,24 @@ discard block |
||
| 163 | 163 | * @param string catalogue |
| 164 | 164 | * @return array catalogue details, array($cat_id, $variant, $count). |
| 165 | 165 | */ |
| 166 | - private function getCatalogueDetails($catalogue = 'messages') |
|
| 166 | + private function getCatalogueDetails($catalogue='messages') |
|
| 167 | 167 | { |
| 168 | 168 | if(empty($catalogue)) |
| 169 | - $catalogue = 'messages'; |
|
| 169 | + $catalogue='messages'; |
|
| 170 | 170 | |
| 171 | - $variant = $catalogue . '.' . $this->culture; |
|
| 171 | + $variant=$catalogue.'.'.$this->culture; |
|
| 172 | 172 | |
| 173 | - $command = $this->getDBConnection()->createCommand( |
|
| 173 | + $command=$this->getDBConnection()->createCommand( |
|
| 174 | 174 | 'SELECT cat_id FROM catalogue WHERE name = :variant'); |
| 175 | 175 | $command->bindParameter(':variant', $variant, PDO::PARAM_STR); |
| 176 | - $cat_id = $command->queryScalar(); |
|
| 176 | + $cat_id=$command->queryScalar(); |
|
| 177 | 177 | |
| 178 | - if ($cat_id === null) return false; |
|
| 178 | + if($cat_id===null) return false; |
|
| 179 | 179 | |
| 180 | - $command = $this->getDBConnection()->createCommand( |
|
| 180 | + $command=$this->getDBConnection()->createCommand( |
|
| 181 | 181 | 'SELECT COUNT(msg_id) FROM trans_unit WHERE cat_id = :catid '); |
| 182 | 182 | $command->bindParameter(':catid', $cat_id, PDO::PARAM_INT); |
| 183 | - $count = $command->queryScalar(); |
|
| 183 | + $count=$command->queryScalar(); |
|
| 184 | 184 | |
| 185 | 185 | return [$cat_id, $variant, $count]; |
| 186 | 186 | } |
@@ -191,12 +191,12 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | private function updateCatalogueTime($cat_id, $variant) |
| 193 | 193 | { |
| 194 | - $time = time(); |
|
| 195 | - $command = $this->getDBConnection()->createCommand( |
|
| 194 | + $time=time(); |
|
| 195 | + $command=$this->getDBConnection()->createCommand( |
|
| 196 | 196 | 'UPDATE catalogue SET date_modified = :moddate WHERE cat_id = :catid'); |
| 197 | 197 | $command->bindParameter(':moddate', $time, PDO::PARAM_INT); |
| 198 | 198 | $command->bindParameter(':catid', $cat_id, PDO::PARAM_INT); |
| 199 | - $result = $command->execute(); |
|
| 199 | + $result=$command->execute(); |
|
| 200 | 200 | |
| 201 | 201 | if(!empty($this->cache)) |
| 202 | 202 | $this->cache->clean($variant, $this->culture); |
@@ -211,25 +211,25 @@ discard block |
||
| 211 | 211 | * @param string the catalogue to add to |
| 212 | 212 | * @return boolean true if saved successfuly, false otherwise. |
| 213 | 213 | */ |
| 214 | - public function save($catalogue = 'messages') |
|
| 214 | + public function save($catalogue='messages') |
|
| 215 | 215 | { |
| 216 | - $messages = $this->untranslated; |
|
| 216 | + $messages=$this->untranslated; |
|
| 217 | 217 | |
| 218 | 218 | if(count($messages) <= 0) return false; |
| 219 | 219 | |
| 220 | - $details = $this->getCatalogueDetails($catalogue); |
|
| 220 | + $details=$this->getCatalogueDetails($catalogue); |
|
| 221 | 221 | |
| 222 | 222 | if($details) |
| 223 | - list($cat_id, $variant, $count) = $details; |
|
| 223 | + list($cat_id, $variant, $count)=$details; |
|
| 224 | 224 | else |
| 225 | 225 | return false; |
| 226 | 226 | |
| 227 | 227 | if($cat_id <= 0) return false; |
| 228 | - $inserted = 0; |
|
| 228 | + $inserted=0; |
|
| 229 | 229 | |
| 230 | - $time = time(); |
|
| 230 | + $time=time(); |
|
| 231 | 231 | |
| 232 | - $command = $this->getDBConnection()->createCommand( |
|
| 232 | + $command=$this->getDBConnection()->createCommand( |
|
| 233 | 233 | 'INSERT INTO trans_unit (cat_id,id,source,date_added) VALUES (:catid,:id,:source,:dateadded)'); |
| 234 | 234 | $command->bindParameter(':catid', $cat_id, PDO::PARAM_INT); |
| 235 | 235 | $command->bindParameter(':id', $count, PDO::PARAM_INT); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | $command->bindParameter(':dateadded', $time, PDO::PARAM_INT); |
| 238 | 238 | foreach($messages as $message) |
| 239 | 239 | { |
| 240 | - if (empty($message)) continue; |
|
| 240 | + if(empty($message)) continue; |
|
| 241 | 241 | $count++; $inserted++; |
| 242 | 242 | $command->execute(); |
| 243 | 243 | } |
@@ -253,20 +253,20 @@ discard block |
||
| 253 | 253 | * @param string the catalogue to delete from. |
| 254 | 254 | * @return boolean true if deleted, false otherwise. |
| 255 | 255 | */ |
| 256 | - public function delete($message, $catalogue = 'messages') |
|
| 256 | + public function delete($message, $catalogue='messages') |
|
| 257 | 257 | { |
| 258 | - $details = $this->getCatalogueDetails($catalogue); |
|
| 258 | + $details=$this->getCatalogueDetails($catalogue); |
|
| 259 | 259 | if($details) |
| 260 | - list($cat_id, $variant, $count) = $details; |
|
| 260 | + list($cat_id, $variant, $count)=$details; |
|
| 261 | 261 | else |
| 262 | 262 | return false; |
| 263 | 263 | |
| 264 | - $command = $this->getDBConnection()->createCommand( |
|
| 264 | + $command=$this->getDBConnection()->createCommand( |
|
| 265 | 265 | 'DELETE FROM trans_unit WHERE cat_id = :catid AND source = :message'); |
| 266 | 266 | $command->bindParameter(':catid', $cat_id, PDO::PARAM_INT); |
| 267 | 267 | $command->bindParameter(':message', $message, PDO::PARAM_STR); |
| 268 | 268 | |
| 269 | - return ($command->execute() == 1) ? $this->updateCatalogueTime($cat_id, $variant) : false; |
|
| 269 | + return ($command->execute()==1) ? $this->updateCatalogueTime($cat_id, $variant) : false; |
|
| 270 | 270 | |
| 271 | 271 | } |
| 272 | 272 | |
@@ -278,16 +278,16 @@ discard block |
||
| 278 | 278 | * @param string the catalogue of the translation. |
| 279 | 279 | * @return boolean true if translation was updated, false otherwise. |
| 280 | 280 | */ |
| 281 | - public function update($text, $target, $comments, $catalogue = 'messages') |
|
| 281 | + public function update($text, $target, $comments, $catalogue='messages') |
|
| 282 | 282 | { |
| 283 | - $details = $this->getCatalogueDetails($catalogue); |
|
| 283 | + $details=$this->getCatalogueDetails($catalogue); |
|
| 284 | 284 | if($details) |
| 285 | - list($cat_id, $variant, $count) = $details; |
|
| 285 | + list($cat_id, $variant, $count)=$details; |
|
| 286 | 286 | else |
| 287 | 287 | return false; |
| 288 | 288 | |
| 289 | - $time = time(); |
|
| 290 | - $command = $this->getDBConnection()->createCommand( |
|
| 289 | + $time=time(); |
|
| 290 | + $command=$this->getDBConnection()->createCommand( |
|
| 291 | 291 | 'UPDATE trans_unit SET target = :target, comments = :comments, date_modified = :datemod |
| 292 | 292 | WHERE cat_id = :catid AND source = :source'); |
| 293 | 293 | $command->bindParameter(':target', $target, PDO::PARAM_STR); |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | $command->bindParameter(':catid', $cat_id, PDO::PARAM_INT); |
| 297 | 297 | $command->bindParameter(':source', $text, PDO::PARAM_STR); |
| 298 | 298 | |
| 299 | - return ($command->execute() == 1) ? $this->updateCatalogueTime($cat_id, $variant) : false; |
|
| 299 | + return ($command->execute()==1) ? $this->updateCatalogueTime($cat_id, $variant) : false; |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /** |
@@ -305,17 +305,17 @@ discard block |
||
| 305 | 305 | */ |
| 306 | 306 | public function catalogues() |
| 307 | 307 | { |
| 308 | - $command = $this->getDBConnection()->createCommand('SELECT name FROM catalogue ORDER BY name'); |
|
| 309 | - $dataReader = $command->query(); |
|
| 308 | + $command=$this->getDBConnection()->createCommand('SELECT name FROM catalogue ORDER BY name'); |
|
| 309 | + $dataReader=$command->query(); |
|
| 310 | 310 | |
| 311 | - $result = []; |
|
| 311 | + $result=[]; |
|
| 312 | 312 | |
| 313 | - foreach ($dataReader as $row) |
|
| 313 | + foreach($dataReader as $row) |
|
| 314 | 314 | { |
| 315 | - $details = explode('.', $row[0]); |
|
| 316 | - if(!isset($details[1])) $details[1] = null; |
|
| 315 | + $details=explode('.', $row[0]); |
|
| 316 | + if(!isset($details[1])) $details[1]=null; |
|
| 317 | 317 | |
| 318 | - $result[] = $details; |
|
| 318 | + $result[]=$details; |
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | return $result; |
@@ -30,6 +30,8 @@ |
||
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @param mixed the data to be bound to this object |
| 33 | + * @param Data\ActiveRecord\TActiveRecord $value |
|
| 34 | + * @return void |
|
| 33 | 35 | */ |
| 34 | 36 | public function setData($value); |
| 35 | 37 | } |
| 36 | 38 | \ No newline at end of file |
@@ -25,6 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * Initializes the module. |
| 27 | 27 | * @param TXmlElement the configuration for the module |
| 28 | + * @return void |
|
| 28 | 29 | */ |
| 29 | 30 | public function init($config); |
| 30 | 31 | /** |
@@ -33,6 +34,7 @@ discard block |
||
| 33 | 34 | public function getID(); |
| 34 | 35 | /** |
| 35 | 36 | * @param string ID of the module |
| 37 | + * @return void |
|
| 36 | 38 | */ |
| 37 | 39 | public function setID($id); |
| 38 | 40 | } |
| 39 | 41 | \ No newline at end of file |
@@ -25,6 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * Initializes the service. |
| 27 | 27 | * @param TXmlElement the configuration for the service |
| 28 | + * @return void |
|
| 28 | 29 | */ |
| 29 | 30 | public function init($config); |
| 30 | 31 | /** |
@@ -33,6 +34,7 @@ discard block |
||
| 33 | 34 | public function getID(); |
| 34 | 35 | /** |
| 35 | 36 | * @param string ID of the service |
| 37 | + * @return void |
|
| 36 | 38 | */ |
| 37 | 39 | public function setID($id); |
| 38 | 40 | /** |
@@ -41,10 +43,12 @@ discard block |
||
| 41 | 43 | public function getEnabled(); |
| 42 | 44 | /** |
| 43 | 45 | * @param boolean whether the service is enabled |
| 46 | + * @return void |
|
| 44 | 47 | */ |
| 45 | 48 | public function setEnabled($value); |
| 46 | 49 | /** |
| 47 | 50 | * Runs the service. |
| 51 | + * @return void |
|
| 48 | 52 | */ |
| 49 | 53 | public function run(); |
| 50 | 54 | } |
| 51 | 55 | \ No newline at end of file |