cmdbobject.class.inc.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. <?php
  2. // Copyright (C) 2010-2012 Combodo SARL
  3. //
  4. // This file is part of iTop.
  5. //
  6. // iTop is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU Affero General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // iTop is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU Affero General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU Affero General Public License
  17. // along with iTop. If not, see <http://www.gnu.org/licenses/>
  18. /**
  19. * Class cmdbObject
  20. *
  21. * @copyright Copyright (C) 2010-2012 Combodo SARL
  22. * @license http://opensource.org/licenses/AGPL-3.0
  23. */
  24. /**
  25. * cmdbObjectClass
  26. * the file to include, then the core is yours
  27. *
  28. * @package iTopORM
  29. */
  30. require_once('coreexception.class.inc.php');
  31. require_once('config.class.inc.php');
  32. require_once('log.class.inc.php');
  33. require_once('kpi.class.inc.php');
  34. require_once('dict.class.inc.php');
  35. require_once('attributedef.class.inc.php');
  36. require_once('filterdef.class.inc.php');
  37. require_once('stimulus.class.inc.php');
  38. require_once('valuesetdef.class.inc.php');
  39. require_once('MyHelpers.class.inc.php');
  40. require_once('expression.class.inc.php');
  41. require_once('cmdbsource.class.inc.php');
  42. require_once('sqlquery.class.inc.php');
  43. require_once('oql/oqlquery.class.inc.php');
  44. require_once('oql/oqlexception.class.inc.php');
  45. require_once('oql/oql-parser.php');
  46. require_once('oql/oql-lexer.php');
  47. require_once('oql/oqlinterpreter.class.inc.php');
  48. require_once('dbobject.class.php');
  49. require_once('dbobjectsearch.class.php');
  50. require_once('dbobjectset.class.php');
  51. require_once('backgroundprocess.inc.php');
  52. require_once('asynctask.class.inc.php');
  53. require_once('dbproperty.class.inc.php');
  54. // db change tracking data model
  55. require_once('cmdbchange.class.inc.php');
  56. require_once('cmdbchangeop.class.inc.php');
  57. // customization data model
  58. // Romain: temporary moved into application.inc.php (see explanations there)
  59. //require_once('trigger.class.inc.php');
  60. //require_once('action.class.inc.php');
  61. // application log
  62. // Romain: temporary moved into application.inc.php (see explanations there)
  63. //require_once('event.class.inc.php');
  64. require_once('templatestring.class.inc.php');
  65. require_once('csvparser.class.inc.php');
  66. require_once('bulkchange.class.inc.php');
  67. /**
  68. * A persistent object, which changes are accurately recorded
  69. *
  70. * @package iTopORM
  71. */
  72. abstract class CMDBObject extends DBObject
  73. {
  74. protected $m_datCreated;
  75. protected $m_datUpdated;
  76. // Note: this value is static, but that could be changed because it is sometimes a real issue (see update of interfaces / connected_to
  77. protected static $m_oCurrChange = null;
  78. protected static $m_sInfo = null; // null => the information is built in a standard way
  79. /**
  80. * Specify another change (this is mainly for backward compatibility)
  81. */
  82. public static function SetCurrentChange(CMDBChange $oChange)
  83. {
  84. self::$m_oCurrChange = $oChange;
  85. }
  86. //
  87. // Todo: simplify the APIs and do not pass the current change as an argument anymore
  88. // SetTrackInfo to be invoked in very few cases (UI.php, CSV import, Data synchro)
  89. // SetCurrentChange is an alternative to SetTrackInfo (csv ?)
  90. // GetCurrentChange to be called ONCE (!) by CMDBChangeOp::OnInsert ($this->Set('change', ..GetCurrentChange())
  91. // GetCurrentChange to create a default change if not already done in the current context
  92. //
  93. /**
  94. * Get a change record (create it if not existing)
  95. */
  96. public static function GetCurrentChange($bAutoCreate = true)
  97. {
  98. if ($bAutoCreate && is_null(self::$m_oCurrChange))
  99. {
  100. self::CreateChange();
  101. }
  102. return self::$m_oCurrChange;
  103. }
  104. /**
  105. * Override the additional information (defaulting to user name)
  106. * A call to this verb should replace every occurence of
  107. * $oMyChange = MetaModel::NewObject("CMDBChange");
  108. * $oMyChange->Set("date", time());
  109. * $oMyChange->Set("userinfo", 'this is done by ... for ...');
  110. * $iChangeId = $oMyChange->DBInsert();
  111. */
  112. public static function SetTrackInfo($sInfo)
  113. {
  114. self::$m_sInfo = $sInfo;
  115. }
  116. /**
  117. * Get the additional information (defaulting to user name)
  118. */
  119. protected static function GetTrackInfo()
  120. {
  121. if (is_null(self::$m_sInfo))
  122. {
  123. return CMDBChange::GetCurrentUserName();
  124. }
  125. else
  126. {
  127. return self::$m_sInfo;
  128. }
  129. }
  130. /**
  131. * Create a standard change record (done here 99% of the time, and nearly once per page)
  132. */
  133. protected static function CreateChange()
  134. {
  135. self::$m_oCurrChange = MetaModel::NewObject("CMDBChange");
  136. self::$m_oCurrChange->Set("date", time());
  137. self::$m_oCurrChange->Set("userinfo", self::GetTrackInfo());
  138. self::$m_oCurrChange->DBInsert();
  139. }
  140. protected function RecordObjCreation()
  141. {
  142. // Delete any existing change tracking about the current object (IDs can be reused due to InnoDb bug; see TRAC #886)
  143. //
  144. // 1 - remove the deletion record(s)
  145. // Note that objclass contain the ROOT class
  146. $oFilter = new DBObjectSearch('CMDBChangeOpDelete');
  147. $oFilter->AddCondition('objclass', MetaModel::GetRootClass(get_class($this)), '=');
  148. $oFilter->AddCondition('objkey', $this->GetKey(), '=');
  149. MetaModel::PurgeData($oFilter);
  150. // 2 - any other change tracking information left prior to 2.0.3 (when the purge of the history has been implemented in RecordObjDeletion
  151. // In that case, objclass is the final class of the object
  152. $oFilter = new DBObjectSearch('CMDBChangeOp');
  153. $oFilter->AddCondition('objclass', get_class($this), '=');
  154. $oFilter->AddCondition('objkey', $this->GetKey(), '=');
  155. MetaModel::PurgeData($oFilter);
  156. parent::RecordObjCreation();
  157. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpCreate");
  158. $oMyChangeOp->Set("objclass", get_class($this));
  159. $oMyChangeOp->Set("objkey", $this->GetKey());
  160. $iId = $oMyChangeOp->DBInsertNoReload();
  161. }
  162. protected function RecordObjDeletion($objkey)
  163. {
  164. $sRootClass = MetaModel::GetRootClass(get_class($this));
  165. // Delete any existing change tracking about the current object
  166. $oFilter = new DBObjectSearch('CMDBChangeOp');
  167. $oFilter->AddCondition('objclass', get_class($this), '=');
  168. $oFilter->AddCondition('objkey', $objkey, '=');
  169. MetaModel::PurgeData($oFilter);
  170. parent::RecordObjDeletion($objkey);
  171. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpDelete");
  172. $oMyChangeOp->Set("objclass", MetaModel::GetRootClass(get_class($this)));
  173. $oMyChangeOp->Set("objkey", $objkey);
  174. $oMyChangeOp->Set("fclass", get_class($this));
  175. $oMyChangeOp->Set("fname", substr($this->GetRawName(), 0, 255)); // Protect against very long friendly names
  176. $iId = $oMyChangeOp->DBInsertNoReload();
  177. }
  178. protected function RecordAttChanges(array $aValues, array $aOrigValues)
  179. {
  180. parent::RecordAttChanges($aValues, $aOrigValues);
  181. // $aValues is an array of $sAttCode => $value
  182. //
  183. foreach ($aValues as $sAttCode=> $value)
  184. {
  185. $oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
  186. if ($oAttDef->IsExternalField()) continue;
  187. if ($oAttDef->IsLinkSet()) continue;
  188. if ($oAttDef->GetTrackingLevel() == ATTRIBUTE_TRACKING_NONE) continue;
  189. if (array_key_exists($sAttCode, $aOrigValues))
  190. {
  191. $original = $aOrigValues[$sAttCode];
  192. }
  193. else
  194. {
  195. $original = null;
  196. }
  197. if ($oAttDef instanceOf AttributeOneWayPassword)
  198. {
  199. // One Way encrypted passwords' history is stored -one way- encrypted
  200. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpSetAttributeOneWayPassword");
  201. $oMyChangeOp->Set("objclass", get_class($this));
  202. $oMyChangeOp->Set("objkey", $this->GetKey());
  203. $oMyChangeOp->Set("attcode", $sAttCode);
  204. if (is_null($original))
  205. {
  206. $original = '';
  207. }
  208. $oMyChangeOp->Set("prev_pwd", $original);
  209. $iId = $oMyChangeOp->DBInsertNoReload();
  210. }
  211. elseif ($oAttDef instanceOf AttributeEncryptedString)
  212. {
  213. // Encrypted string history is stored encrypted
  214. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpSetAttributeEncrypted");
  215. $oMyChangeOp->Set("objclass", get_class($this));
  216. $oMyChangeOp->Set("objkey", $this->GetKey());
  217. $oMyChangeOp->Set("attcode", $sAttCode);
  218. if (is_null($original))
  219. {
  220. $original = '';
  221. }
  222. $oMyChangeOp->Set("prevstring", $original);
  223. $iId = $oMyChangeOp->DBInsertNoReload();
  224. }
  225. elseif ($oAttDef instanceOf AttributeBlob)
  226. {
  227. // Data blobs
  228. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpSetAttributeBlob");
  229. $oMyChangeOp->Set("objclass", get_class($this));
  230. $oMyChangeOp->Set("objkey", $this->GetKey());
  231. $oMyChangeOp->Set("attcode", $sAttCode);
  232. if (is_null($original))
  233. {
  234. $original = new ormDocument();
  235. }
  236. $oMyChangeOp->Set("prevdata", $original);
  237. $iId = $oMyChangeOp->DBInsertNoReload();
  238. }
  239. elseif ($oAttDef instanceOf AttributeStopWatch)
  240. {
  241. // Stop watches - record changes for sub items only (they are visible, the rest is not visible)
  242. //
  243. if (is_null($original))
  244. {
  245. $original = new OrmStopWatch();
  246. }
  247. foreach ($oAttDef->ListSubItems() as $sSubItemAttCode => $oSubItemAttDef)
  248. {
  249. $item_value = $oSubItemAttDef->GetValue($value);
  250. $item_original = $oSubItemAttDef->GetValue($original);
  251. if ($item_value != $item_original)
  252. {
  253. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpSetAttributeScalar");
  254. $oMyChangeOp->Set("objclass", get_class($this));
  255. $oMyChangeOp->Set("objkey", $this->GetKey());
  256. $oMyChangeOp->Set("attcode", $sSubItemAttCode);
  257. $oMyChangeOp->Set("oldvalue", $item_original);
  258. $oMyChangeOp->Set("newvalue", $item_value);
  259. $iId = $oMyChangeOp->DBInsertNoReload();
  260. }
  261. }
  262. }
  263. elseif ($oAttDef instanceOf AttributeCaseLog)
  264. {
  265. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpSetAttributeCaseLog");
  266. $oMyChangeOp->Set("objclass", get_class($this));
  267. $oMyChangeOp->Set("objkey", $this->GetKey());
  268. $oMyChangeOp->Set("attcode", $sAttCode);
  269. $oMyChangeOp->Set("lastentry", $value->GetLatestEntryIndex());
  270. $iId = $oMyChangeOp->DBInsertNoReload();
  271. }
  272. elseif ($oAttDef instanceOf AttributeLongText)
  273. {
  274. // Data blobs
  275. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpSetAttributeLongText");
  276. $oMyChangeOp->Set("objclass", get_class($this));
  277. $oMyChangeOp->Set("objkey", $this->GetKey());
  278. $oMyChangeOp->Set("attcode", $sAttCode);
  279. if (!is_null($original) && ($original instanceof ormCaseLog))
  280. {
  281. $original = $original->GetText();
  282. }
  283. $oMyChangeOp->Set("prevdata", $original);
  284. $iId = $oMyChangeOp->DBInsertNoReload();
  285. }
  286. elseif ($oAttDef instanceOf AttributeText)
  287. {
  288. // Data blobs
  289. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpSetAttributeText");
  290. $oMyChangeOp->Set("objclass", get_class($this));
  291. $oMyChangeOp->Set("objkey", $this->GetKey());
  292. $oMyChangeOp->Set("attcode", $sAttCode);
  293. if (!is_null($original) && ($original instanceof ormCaseLog))
  294. {
  295. $original = $original->GetText();
  296. }
  297. $oMyChangeOp->Set("prevdata", $original);
  298. $iId = $oMyChangeOp->DBInsertNoReload();
  299. }
  300. elseif ($oAttDef instanceOf AttributeBoolean)
  301. {
  302. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpSetAttributeScalar");
  303. $oMyChangeOp->Set("objclass", get_class($this));
  304. $oMyChangeOp->Set("objkey", $this->GetKey());
  305. $oMyChangeOp->Set("attcode", $sAttCode);
  306. $oMyChangeOp->Set("oldvalue", $original ? 1 : 0);
  307. $oMyChangeOp->Set("newvalue", $value ? 1 : 0);
  308. $iId = $oMyChangeOp->DBInsertNoReload();
  309. }
  310. elseif ($oAttDef instanceOf AttributeHierarchicalKey)
  311. {
  312. // Hierarchical keys
  313. //
  314. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpSetAttributeScalar");
  315. $oMyChangeOp->Set("objclass", get_class($this));
  316. $oMyChangeOp->Set("objkey", $this->GetKey());
  317. $oMyChangeOp->Set("attcode", $sAttCode);
  318. $oMyChangeOp->Set("oldvalue", $original);
  319. $oMyChangeOp->Set("newvalue", $value[$sAttCode]);
  320. $iId = $oMyChangeOp->DBInsertNoReload();
  321. }
  322. else
  323. {
  324. // Scalars
  325. //
  326. $oMyChangeOp = MetaModel::NewObject("CMDBChangeOpSetAttributeScalar");
  327. $oMyChangeOp->Set("objclass", get_class($this));
  328. $oMyChangeOp->Set("objkey", $this->GetKey());
  329. $oMyChangeOp->Set("attcode", $sAttCode);
  330. $oMyChangeOp->Set("oldvalue", $original);
  331. $oMyChangeOp->Set("newvalue", $value);
  332. $iId = $oMyChangeOp->DBInsertNoReload();
  333. }
  334. }
  335. }
  336. /**
  337. * Helper to ultimately check user rights before writing (Insert, Update or Delete)
  338. * The check should never fail, because the UI should prevent from such a usage
  339. * Anyhow, if the user has found a workaround... the security gets enforced here
  340. */
  341. protected function CheckUserRights($bSkipStrongSecurity, $iActionCode)
  342. {
  343. if (is_null($bSkipStrongSecurity))
  344. {
  345. // This is temporary
  346. // We have implemented this safety net right before releasing iTop 1.0
  347. // and we decided that it was too risky to activate it
  348. // Anyhow, users willing to have a very strong security could set
  349. // skip_strong_security = 0, in the config file
  350. $bSkipStrongSecurity = MetaModel::GetConfig()->Get('skip_strong_security');
  351. }
  352. if (!$bSkipStrongSecurity)
  353. {
  354. $sClass = get_class($this);
  355. $oSet = DBObjectSet::FromObject($this);
  356. if (!UserRights::IsActionAllowed($sClass, $iActionCode, $oSet))
  357. {
  358. // Intrusion detected
  359. throw new SecurityException('You are not allowed to modify objects of class: '.$sClass);
  360. }
  361. }
  362. }
  363. public function DBInsert()
  364. {
  365. return $this->DBInsertTracked_Internal();
  366. }
  367. public function DBInsertTracked(CMDBChange $oChange, $bSkipStrongSecurity = null)
  368. {
  369. self::SetCurrentChange($oChange);
  370. $this->CheckUserRights($bSkipStrongSecurity, UR_ACTION_MODIFY);
  371. $ret = $this->DBInsertTracked_Internal();
  372. return $ret;
  373. }
  374. public function DBInsertTrackedNoReload(CMDBChange $oChange, $bSkipStrongSecurity = null)
  375. {
  376. self::SetCurrentChange($oChange);
  377. $this->CheckUserRights($bSkipStrongSecurity, UR_ACTION_MODIFY);
  378. $ret = $this->DBInsertTracked_Internal(true);
  379. return $ret;
  380. }
  381. protected function DBInsertTracked_Internal($bDoNotReload = false)
  382. {
  383. if ($bDoNotReload)
  384. {
  385. $ret = parent::DBInsertNoReload();
  386. }
  387. else
  388. {
  389. $ret = parent::DBInsert();
  390. }
  391. return $ret;
  392. }
  393. public function DBClone($newKey = null)
  394. {
  395. return $this->DBCloneTracked_Internal();
  396. }
  397. public function DBCloneTracked(CMDBChange $oChange, $newKey = null)
  398. {
  399. self::SetCurrentChange($oChange);
  400. $this->DBCloneTracked_Internal($newKey);
  401. }
  402. protected function DBCloneTracked_Internal($newKey = null)
  403. {
  404. $newKey = parent::DBClone($newKey);
  405. $oClone = MetaModel::GetObject(get_class($this), $newKey);
  406. return $newKey;
  407. }
  408. public function DBUpdate()
  409. {
  410. // Copy the changes list before the update (the list should be reset afterwards)
  411. $aChanges = $this->ListChanges();
  412. if (count($aChanges) == 0)
  413. {
  414. return;
  415. }
  416. $ret = parent::DBUpdate();
  417. return $ret;
  418. }
  419. public function DBUpdateTracked(CMDBChange $oChange, $bSkipStrongSecurity = null)
  420. {
  421. self::SetCurrentChange($oChange);
  422. $this->CheckUserRights($bSkipStrongSecurity, UR_ACTION_MODIFY);
  423. $this->DBUpdate();
  424. }
  425. public function DBDelete(&$oDeletionPlan = null)
  426. {
  427. return $this->DBDeleteTracked_Internal($oDeletionPlan);
  428. }
  429. public function DBDeleteTracked(CMDBChange $oChange, $bSkipStrongSecurity = null, &$oDeletionPlan = null)
  430. {
  431. self::SetCurrentChange($oChange);
  432. $this->CheckUserRights($bSkipStrongSecurity, UR_ACTION_DELETE);
  433. $this->DBDeleteTracked_Internal($oDeletionPlan);
  434. }
  435. protected function DBDeleteTracked_Internal(&$oDeletionPlan = null)
  436. {
  437. $prevkey = $this->GetKey();
  438. $ret = parent::DBDelete($oDeletionPlan);
  439. return $ret;
  440. }
  441. public static function BulkUpdate(DBObjectSearch $oFilter, array $aValues)
  442. {
  443. return $this->BulkUpdateTracked_Internal($oFilter, $aValues);
  444. }
  445. public static function BulkUpdateTracked(CMDBChange $oChange, DBObjectSearch $oFilter, array $aValues)
  446. {
  447. self::SetCurrentChange($oChange);
  448. $this->BulkUpdateTracked_Internal($oFilter, $aValues);
  449. }
  450. protected static function BulkUpdateTracked_Internal(DBObjectSearch $oFilter, array $aValues)
  451. {
  452. // $aValues is an array of $sAttCode => $value
  453. // Get the list of objects to update (and load it before doing the change)
  454. $oObjSet = new CMDBObjectSet($oFilter);
  455. $oObjSet->Load();
  456. // Keep track of the previous values (will be overwritten when the objects are synchronized with the DB)
  457. $aOriginalValues = array();
  458. $oObjSet->Rewind();
  459. while ($oItem = $oObjSet->Fetch())
  460. {
  461. $aOriginalValues[$oItem->GetKey()] = $oItem->m_aOrigValues;
  462. }
  463. // Update in one single efficient query
  464. $ret = parent::BulkUpdate($oFilter, $aValues);
  465. // Record... in many queries !!!
  466. $oObjSet->Rewind();
  467. while ($oItem = $oObjSet->Fetch())
  468. {
  469. $aChangedValues = $oItem->ListChangedValues($aValues);
  470. $oItem->RecordAttChanges($aChangedValues, $aOriginalValues[$oItem->GetKey()]);
  471. }
  472. return $ret;
  473. }
  474. }
  475. /**
  476. * TODO: investigate how to get rid of this class that was made to workaround some language limitation... or a poor design!
  477. *
  478. * @package iTopORM
  479. */
  480. class CMDBObjectSet extends DBObjectSet
  481. {
  482. // this is the public interface (?)
  483. // I have to define those constructors here... :-(
  484. // just to get the right object class in return.
  485. // I have to think again to those things: maybe it will work fine if a have a constructor define here (?)
  486. static public function FromScratch($sClass)
  487. {
  488. $oFilter = new CMDBSearchFilter($sClass);
  489. $oFilter->AddConditionExpression(new FalseExpression());
  490. $oRetSet = new self($oFilter);
  491. // NOTE: THIS DOES NOT WORK IF m_bLoaded is private in the base class (and you will not get any error message)
  492. $oRetSet->m_bLoaded = true; // no DB load
  493. return $oRetSet;
  494. }
  495. // create an object set ex nihilo
  496. // input = array of objects
  497. static public function FromArray($sClass, $aObjects)
  498. {
  499. $oRetSet = self::FromScratch($sClass);
  500. $oRetSet->AddObjectArray($aObjects, $sClass);
  501. return $oRetSet;
  502. }
  503. static public function FromArrayAssoc($aClasses, $aObjects)
  504. {
  505. // In a perfect world, we should create a complete tree of DBObjectSearch,
  506. // but as we lack most of the information related to the objects,
  507. // let's create one search definition
  508. $sClass = reset($aClasses);
  509. $sAlias = key($aClasses);
  510. $oFilter = new CMDBSearchFilter($sClass, $sAlias);
  511. $oRetSet = new CMDBObjectSet($oFilter);
  512. $oRetSet->m_bLoaded = true; // no DB load
  513. foreach($aObjects as $rowIndex => $aObjectsByClassAlias)
  514. {
  515. $oRetSet->AddObjectExtended($aObjectsByClassAlias);
  516. }
  517. return $oRetSet;
  518. }
  519. }
  520. /**
  521. * TODO: investigate how to get rid of this class that was made to workaround some language limitation... or a poor design!
  522. *
  523. * @package iTopORM
  524. */
  525. class CMDBSearchFilter extends DBObjectSearch
  526. {
  527. // this is the public interface (?)
  528. }
  529. ?>