PageRenderTime 53ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/webroot/updates/concrete5.6.0.2/concrete/core/models/attribute/key.php

https://bitbucket.org/microwebedu/registratie_carem
PHP | 642 lines | 468 code | 90 blank | 84 comment | 68 complexity | 4225fbeff376c3575b7fd57fd14a61b4 MD5 | raw file
Possible License(s): MIT, LGPL-2.1, BSD-3-Clause
  1. <?php
  2. defined('C5_EXECUTE') or die("Access Denied.");
  3. class Concrete5_Model_AttributeKey extends Object {
  4. public function getIndexedSearchTable() {return false;}
  5. public function getSearchIndexFieldDefinition() {
  6. return $this->searchIndexFieldDefinition;
  7. }
  8. /**
  9. * Returns the name for this attribute key
  10. */
  11. public function getAttributeKeyName() { return $this->akName;}
  12. /**
  13. * Returns the handle for this attribute key
  14. */
  15. public function getAttributeKeyHandle() { return $this->akHandle;}
  16. public function getAttributeKeyDisplayHandle() {
  17. return Loader::helper('text')->unhandle($this->akHandle);
  18. }
  19. /**
  20. * Returns the ID for this attribute key
  21. */
  22. public function getAttributeKeyID() {return $this->akID;}
  23. public function getAttributeKeyCategoryID() {return $this->akCategoryID;}
  24. /**
  25. * Returns whether the attribute key is searchable
  26. */
  27. public function isAttributeKeySearchable() {return $this->akIsSearchable;}
  28. /**
  29. * Returns whether the attribute key is internal
  30. */
  31. public function isAttributeKeyInternal() {return $this->akIsInternal;}
  32. /**
  33. * Returns whether the attribute key is indexed as a "keyword search" field.
  34. */
  35. public function isAttributeKeyContentIndexed() {return $this->akIsSearchableIndexed;}
  36. /**
  37. * Returns whether the attribute key is one that was automatically created by a process.
  38. */
  39. public function isAttributeKeyAutoCreated() {return $this->akIsAutoCreated;}
  40. /**
  41. * Returns whether the attribute key is included in the standard search for this category.
  42. */
  43. public function isAttributeKeyColumnHeader() {return $this->akIsColumnHeader;}
  44. /**
  45. * Returns whether the attribute key is one that can be edited through the frontend.
  46. */
  47. public function isAttributeKeyEditable() {return $this->akIsEditable;}
  48. /**
  49. * Loads the required attribute fields for this instantiated attribute
  50. */
  51. protected function load($akID) {
  52. $db = Loader::db();
  53. $akunhandle = Loader::helper('text')->uncamelcase(get_class($this));
  54. $akCategoryHandle = substr($akunhandle, 0, strpos($akunhandle, '_attribute_key'));
  55. if ($akCategoryHandle != '') {
  56. $row = $db->GetRow('select akID, akHandle, akName, AttributeKeys.akCategoryID, akIsInternal, akIsEditable, akIsSearchable, akIsSearchableIndexed, akIsAutoCreated, akIsColumnHeader, AttributeKeys.atID, atHandle, AttributeKeys.pkgID from AttributeKeys inner join AttributeKeyCategories on AttributeKeys.akCategoryID = AttributeKeyCategories.akCategoryID inner join AttributeTypes on AttributeKeys.atID = AttributeTypes.atID where akID = ? and akCategoryHandle = ?', array($akID, $akCategoryHandle));
  57. } else {
  58. $row = $db->GetRow('select akID, akHandle, akName, akCategoryID, akIsEditable, akIsInternal, akIsSearchable, akIsSearchableIndexed, akIsAutoCreated, akIsColumnHeader, AttributeKeys.atID, atHandle, AttributeKeys.pkgID from AttributeKeys inner join AttributeTypes on AttributeKeys.atID = AttributeTypes.atID where akID = ?', array($akID));
  59. }
  60. $this->setPropertiesFromArray($row);
  61. }
  62. public function getPackageID() { return $this->pkgID;}
  63. public function getPackageHandle() {
  64. return PackageList::getHandle($this->pkgID);
  65. }
  66. public static function getInstanceByID($akID) {
  67. $db = Loader::db();
  68. $akCategoryID = $db->GetOne('select akCategoryID from AttributeKeys where akID = ?', $akID);
  69. if ($akCategoryID > 0) {
  70. $akc = AttributeKeyCategory::getByID($akCategoryID);
  71. return $akc->getAttributeKeyByID($akID);
  72. }
  73. }
  74. /**
  75. * Returns an attribute type object
  76. */
  77. public function getAttributeType() {
  78. return AttributeType::getByID($this->atID);
  79. }
  80. //deprecated
  81. public function getAttributeKeyType(){ return $this->getAttributeType(); }
  82. /**
  83. * Returns a list of all attributes of this category
  84. */
  85. public static function getList($akCategoryHandle, $filters = array()) {
  86. $db = Loader::db();
  87. $pkgHandle = $db->GetOne('select pkgHandle from AttributeKeyCategories inner join Packages on Packages.pkgID = AttributeKeyCategories.pkgID where akCategoryHandle = ?', array($akCategoryHandle));
  88. $q = 'select akID from AttributeKeys inner join AttributeKeyCategories on AttributeKeys.akCategoryID = AttributeKeyCategories.akCategoryID where akCategoryHandle = ?';
  89. foreach($filters as $key => $value) {
  90. $q .= ' and ' . $key . ' = ' . $value . ' ';
  91. }
  92. $r = $db->Execute($q, array($akCategoryHandle));
  93. $list = array();
  94. $txt = Loader::helper('text');
  95. if ($pkgHandle) {
  96. Loader::model('attribute/categories/' . $akCategoryHandle, $pkgHandle);
  97. } else {
  98. Loader::model('attribute/categories/' . $akCategoryHandle);
  99. }
  100. $className = $txt->camelcase($akCategoryHandle);
  101. while ($row = $r->FetchRow()) {
  102. $c1 = $className . 'AttributeKey';
  103. $c1a = call_user_func(array($c1, 'getByID'), $row['akID']);
  104. if (is_object($c1a)) {
  105. $list[] = $c1a;
  106. }
  107. }
  108. $r->Close();
  109. return $list;
  110. }
  111. public function export($axml, $exporttype = 'full') {
  112. $type = $this->getAttributeType()->getAttributeTypeHandle();
  113. $category = AttributeKeyCategory::getByID($this->akCategoryID)->getAttributeKeyCategoryHandle();
  114. $akey = $axml->addChild('attributekey');
  115. $akey->addAttribute('handle',$this->getAttributeKeyHandle());
  116. if ($exporttype == 'full') {
  117. $akey->addAttribute('name', $this->getAttributeKeyName());
  118. $akey->addAttribute('package', $this->getPackageHandle());
  119. $akey->addAttribute('searchable', $this->isAttributeKeySearchable());
  120. $akey->addAttribute('indexed', $this->isAttributeKeySearchable());
  121. $akey->addAttribute('type', $type);
  122. $akey->addAttribute('category', $category);
  123. $this->getController()->exportKey($akey);
  124. }
  125. return $akey;
  126. }
  127. public static function exportList($xml) {
  128. $categories = AttributeKeyCategory::getList();
  129. $axml = $xml->addChild('attributekeys');
  130. foreach($categories as $cat) {
  131. $attributes = AttributeKey::getList($cat->getAttributeKeyCategoryHandle());
  132. foreach($attributes as $at) {
  133. $at->export($axml);
  134. }
  135. }
  136. }
  137. /**
  138. * Note, this queries both the pkgID found on the AttributeKeys table AND any attribute keys of a special type
  139. * installed by that package, and any in categories by that package.
  140. * That's because a special type, if the package is uninstalled, is going to be unusable
  141. * by attribute keys that still remain.
  142. */
  143. public static function getListByPackage($pkg) {
  144. $db = Loader::db();
  145. $list = array();
  146. $tina[] = '-1';
  147. $tinb = $db->GetCol('select atID from AttributeTypes where pkgID = ?', $pkg->getPackageID());
  148. if (is_array($tinb)) {
  149. $tina = array_merge($tina, $tinb);
  150. }
  151. $tinstr = implode(',', $tina);
  152. $kina[] = '-1';
  153. $kinb = $db->GetCol('select akCategoryID from AttributeKeyCategories where pkgID = ?', $pkg->getPackageID());
  154. if (is_array($kinb)) {
  155. $kina = array_merge($kina, $kinb);
  156. }
  157. $kinstr = implode(',', $kina);
  158. $r = $db->Execute('select akID, akCategoryID from AttributeKeys where (pkgID = ? or atID in (' . $tinstr . ') or akCategoryID in (' . $kinstr . ')) order by akID asc', array($pkg->getPackageID()));
  159. while ($row = $r->FetchRow()) {
  160. $akc = AttributeKeyCategory::getByID($row['akCategoryID']);
  161. $ak = $akc->getAttributeKeyByID($row['akID']);
  162. $list[] = $ak;
  163. }
  164. $r->Close();
  165. return $list;
  166. }
  167. public static function import(SimpleXMLElement $ak) {
  168. $type = AttributeType::getByHandle($ak['type']);
  169. $akCategoryHandle = $ak['category'];
  170. $pkg = false;
  171. if ($ak['package']) {
  172. $pkg = Package::getByHandle($ak['package']);
  173. }
  174. $akIsInternal = 0;
  175. if ($ak['internal']) {
  176. $akIsInternal = 1;
  177. }
  178. $akn = self::add($akCategoryHandle, $type, array('akHandle' => $ak['handle'], 'akName' => $ak['name'], 'akIsInternal' => $akIsInternal, 'akIsSearchableIndexed' => $ak['indexed'], 'akIsSearchable' => $ak['searchable']), $pkg);
  179. $akn->getController()->importKey($ak);
  180. }
  181. /**
  182. * Adds an attribute key.
  183. */
  184. protected function add($akCategoryHandle, $type, $args, $pkg = false) {
  185. $vn = Loader::helper('validation/numbers');
  186. $txt = Loader::helper('text');
  187. if (!is_object($type)) {
  188. // The passed item is not an object. It is probably something like 'DATE'
  189. $type = AttributeType::getByHandle(strtolower($type));
  190. }
  191. $atID = $type->getAttributeTypeID();
  192. $pkgID = 0;
  193. if (is_object($pkg)) {
  194. $pkgID = $pkg->getPackageID();
  195. }
  196. extract($args);
  197. $_akIsSearchable = 1;
  198. $_akIsSearchableIndexed = 1;
  199. $_akIsAutoCreated = 1;
  200. $_akIsEditable = 1;
  201. $_akIsInternal = 0;
  202. if (!$akIsSearchable) {
  203. $_akIsSearchable = 0;
  204. }
  205. if ($akIsInternal) {
  206. $_akIsInternal = 1;
  207. }
  208. if (!$akIsSearchableIndexed) {
  209. $_akIsSearchableIndexed = 0;
  210. }
  211. if (!$akIsAutoCreated) {
  212. $_akIsAutoCreated = 0;
  213. }
  214. if (isset($akIsEditable) && (!$akIsEditable)) {
  215. $_akIsEditable = 0;
  216. }
  217. $db = Loader::db();
  218. $akCategoryID = $db->GetOne("select akCategoryID from AttributeKeyCategories where akCategoryHandle = ?", $akCategoryHandle);
  219. $a = array($akHandle, $akName, $_akIsSearchable, $_akIsSearchableIndexed, $_akIsInternal, $_akIsAutoCreated, $_akIsEditable, $atID, $akCategoryID, $pkgID);
  220. $r = $db->query("insert into AttributeKeys (akHandle, akName, akIsSearchable, akIsSearchableIndexed, akIsInternal, akIsAutoCreated, akIsEditable, atID, akCategoryID, pkgID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", $a);
  221. $category = AttributeKeyCategory::getByID($akCategoryID);
  222. if ($r) {
  223. $akID = $db->Insert_ID();
  224. $className = $txt->camelcase($akCategoryHandle) . 'AttributeKey';
  225. $ak = new $className();
  226. $ak->load($akID);
  227. switch($category->allowAttributeSets()) {
  228. case AttributeKeyCategory::ASET_ALLOW_SINGLE:
  229. if ($asID > 0) {
  230. $ak->setAttributeSet(AttributeSet::getByID($asID));
  231. }
  232. break;
  233. }
  234. $at = $ak->getAttributeType();
  235. $cnt = $at->getController();
  236. $cnt->setAttributeKey($ak);
  237. $cnt->saveKey($args);
  238. $ak->updateSearchIndex();
  239. $at->__destruct();
  240. unset($at);
  241. unset($cnt);
  242. return $ak;
  243. }
  244. }
  245. public function refreshCache() {
  246. Cache::delete(Loader::helper('text')->uncamelcase(get_class($this)), $this->getAttributeKeyID());
  247. }
  248. /**
  249. * Updates an attribute key.
  250. */
  251. public function update($args) {
  252. $prevHandle = $this->getAttributeKeyHandle();
  253. extract($args);
  254. if (!$akIsSearchable) {
  255. $akIsSearchable = 0;
  256. }
  257. if (!$akIsSearchableIndexed) {
  258. $akIsSearchableIndexed = 0;
  259. }
  260. $db = Loader::db();
  261. $akCategoryHandle = $db->GetOne("select akCategoryHandle from AttributeKeyCategories inner join AttributeKeys on AttributeKeys.akCategoryID = AttributeKeyCategories.akCategoryID where akID = ?", $this->getAttributeKeyID());
  262. $a = array($akHandle, $akName, $akIsSearchable, $akIsSearchableIndexed, $this->getAttributeKeyID());
  263. $r = $db->query("update AttributeKeys set akHandle = ?, akName = ?, akIsSearchable = ?, akIsSearchableIndexed = ? where akID = ?", $a);
  264. $category = AttributeKeyCategory::getByID($this->akCategoryID);
  265. switch($category->allowAttributeSets()) {
  266. case AttributeKeyCategory::ASET_ALLOW_SINGLE:
  267. if ($asID > 0) {
  268. $as = AttributeSet::getByID($asID);
  269. if ((!$this->inAttributeSet($as)) && is_object($as)) {
  270. $this->clearAttributeSets();
  271. $this->setAttributeSet($as);
  272. }
  273. } else {
  274. // clear set
  275. $this->clearAttributeSets();
  276. }
  277. break;
  278. }
  279. if ($r) {
  280. $txt = Loader::helper('text');
  281. $className = $txt->camelcase($akCategoryHandle) . 'AttributeKey';
  282. $ak = new $className();
  283. $ak->load($this->getAttributeKeyID());
  284. $at = $ak->getAttributeType();
  285. $cnt = $at->getController();
  286. $cnt->setAttributeKey($ak);
  287. $cnt->saveKey($args);
  288. $this->refreshCache();
  289. $ak->updateSearchIndex($prevHandle);
  290. return $ak;
  291. }
  292. }
  293. /**
  294. * Duplicates an attribute key
  295. */
  296. public function duplicate($args = array()) {
  297. $ar = new ADODB_Active_Record('AttributeKeys');
  298. $ar->Load('akID=?', array($this->akID));
  299. $ar2 = clone $ar;
  300. $ar2->akID = null;
  301. foreach($args as $key=>$value) {
  302. $ar2->{$key} = $value;
  303. }
  304. $ar2->Insert();
  305. $db = Loader::db();
  306. $ak = new AttributeKey();
  307. $ak->load($db->Insert_ID());
  308. // now we duplicate the specific category fields
  309. $this->getController()->duplicateKey($ak);
  310. return $ak;
  311. }
  312. public function inAttributeSet($as) {
  313. if (is_object($as)) {
  314. return $as->contains($this);
  315. }
  316. }
  317. public function setAttributeKeyColumnHeader($r) {
  318. $db = Loader::db();
  319. $r = ($r == true) ? 1 : 0;
  320. $db->Execute('update AttributeKeys set akIsColumnHeader = ? where akID = ?', array($r, $this->getAttributeKeyID()));
  321. }
  322. public function reindex($tbl, $columnHeaders, $attribs, $rs) {
  323. $db = Loader::db();
  324. $columns = $db->MetaColumns($tbl);
  325. foreach($attribs as $akHandle => $value) {
  326. if (is_array($value)) {
  327. foreach($value as $key => $v) {
  328. $column = 'ak_' . $akHandle . '_' . $key;
  329. if (isset($columns[strtoupper($column)])) {
  330. $columnHeaders[$column] = $v;
  331. }
  332. }
  333. } else {
  334. $column = 'ak_' . $akHandle;
  335. if (isset($columns[strtoupper($column)])) {
  336. $columnHeaders[$column] = $value;
  337. }
  338. }
  339. }
  340. //this shouldn't be necessary, but i had a saying telling me that the static variable 'db' was protected,
  341. //even though it was declared as public
  342. $q = $db->GetInsertSQL($rs, $columnHeaders);
  343. $r = $db->Execute($q);
  344. $r->Close();
  345. $rs->Close();
  346. }
  347. public function updateSearchIndex($prevHandle = false) {
  348. $type = $this->getAttributeType();
  349. $cnt = $type->getController();
  350. if ($this->getIndexedSearchTable() == false) {
  351. return false;
  352. }
  353. if ($cnt->getSearchIndexFieldDefinition() == false) {
  354. return false;
  355. }
  356. $fields = array();
  357. if (!is_array($cnt->getSearchIndexFieldDefinition())) {
  358. $fields[] = $this->akHandle . ' ' . $cnt->getSearchIndexFieldDefinition();
  359. } else {
  360. foreach($cnt->getSearchIndexFieldDefinition() as $col => $def) {
  361. $fields[$col] = $this->akHandle . '_' . $col . ' ' . $def;
  362. }
  363. }
  364. $db = Loader::db();
  365. $columns = $db->MetaColumns($this->getIndexedSearchTable());
  366. $dba = NewDataDictionary($db, DB_TYPE);
  367. foreach($fields as $col => $field) {
  368. $addColumn = true;
  369. $field = 'ak_' . $field;
  370. if (!is_int($col)) {
  371. $column = 'ak_' . $this->akHandle . '_' . $col;
  372. } else {
  373. $column = 'ak_' . $this->akHandle;
  374. }
  375. if ($prevHandle != false) {
  376. if (!is_int($col)) {
  377. $prevColumn = 'ak_' . $prevHandle . '_' . $col;
  378. } else {
  379. $prevColumn = 'ak_' . $prevHandle;
  380. }
  381. }
  382. if ($prevColumn != false) {
  383. if ($columns[strtoupper($prevColumn)]) {
  384. $q = $dba->RenameColumnSQL($this->getIndexedSearchTable(), $prevColumn, $column, $field);
  385. $db->Execute($q[0]);
  386. $addColumn = false;
  387. }
  388. }
  389. if ($addColumn) {
  390. if (!$columns[strtoupper($column)]) {
  391. $q = $dba->AddColumnSQL($this->getIndexedSearchTable(), $field);
  392. $db->Execute($q[0]);
  393. }
  394. }
  395. }
  396. }
  397. public function delete() {
  398. $at = $this->getAttributeType();
  399. $at->controller->setAttributeKey($this);
  400. $at->controller->deleteKey();
  401. $cnt = $this->getController();
  402. $db = Loader::db();
  403. $db->Execute('delete from AttributeKeys where akID = ?', array($this->getAttributeKeyID()));
  404. $db->Execute('delete from AttributeSetKeys where akID = ?', array($this->getAttributeKeyID()));
  405. if ($this->getIndexedSearchTable()) {
  406. $columns = $db->MetaColumns($this->getIndexedSearchTable());
  407. $dba = NewDataDictionary($db, DB_TYPE);
  408. $fields = array();
  409. if (!is_array($cnt->getSearchIndexFieldDefinition())) {
  410. $dropColumns[] = 'ak_' . $this->akHandle;
  411. } else {
  412. foreach($cnt->getSearchIndexFieldDefinition() as $col => $def) {
  413. $dropColumns[] = 'ak_' . $this->akHandle . '_' . $col;
  414. }
  415. }
  416. foreach($dropColumns as $dc) {
  417. if ($columns[strtoupper($dc)]) {
  418. $q = $dba->DropColumnSQL($this->getIndexedSearchTable(), $dc);
  419. $db->Execute($q[0]);
  420. }
  421. }
  422. }
  423. $this->refreshCache();
  424. }
  425. public function getAttributeValueIDList() {
  426. $db = Loader::db();
  427. $ids = array();
  428. $r = $db->Execute('select avID from AttributeValues where akID = ?', array($this->getAttributeKeyID()));
  429. while ($row = $r->FetchRow()) {
  430. $ids[] = $row['avID'];
  431. }
  432. $r->Close();
  433. return $ids;
  434. }
  435. /**
  436. * Adds a generic attribute record (with this type) to the AttributeValues table
  437. */
  438. public function addAttributeValue() {
  439. $db = Loader::db();
  440. $u = new User();
  441. $dh = Loader::helper('date');
  442. $uID = $u->isRegistered() ? $u->getUserID() : 0;
  443. $avDate = $dh->getLocalDateTime();
  444. $v = array($this->atID, $this->akID, $uID, $avDate);
  445. $db->Execute('insert into AttributeValues (atID, akID, uID, avDateAdded) values (?, ?, ?, ?)', $v);
  446. $avID = $db->Insert_ID();
  447. return AttributeValue::getByID($avID);
  448. }
  449. public function getAttributeKeyIconSRC() {
  450. $type = $this->getAttributeType();
  451. return $type->getAttributeTypeIconSRC();
  452. }
  453. public function getController() {
  454. $at = AttributeType::getByHandle($this->atHandle);
  455. $cnt = $at->getController();
  456. $cnt->setAttributeKey($this);
  457. return $cnt;
  458. }
  459. /**
  460. * Renders a view for this attribute key. If no view is default we display it's "view"
  461. * Valid views are "view", "form" or a custom view (if the attribute has one in its directory)
  462. * Additionally, an attribute does not have to have its own interface. If it doesn't, then whatever
  463. * is printed in the corresponding $view function in the attribute's controller is printed out.
  464. */
  465. public function render($view = 'view', $value = false, $return = false) {
  466. $at = AttributeType::getByHandle($this->atHandle);
  467. $resp = $at->render($view, $this, $value, $return);
  468. if ($return) {
  469. return $resp;
  470. }
  471. }
  472. /**
  473. * Calls the functions necessary to save this attribute to the database. If no passed value is passed, then we save it via the stock form.
  474. */
  475. protected function saveAttribute($attributeValue, $passedValue = false) {
  476. $at = $this->getAttributeType();
  477. $at->controller->setAttributeKey($this);
  478. $at->controller->setAttributeValue($attributeValue);
  479. if ($passedValue) {
  480. $at->controller->saveValue($passedValue);
  481. } else {
  482. $at->controller->saveForm($at->controller->post());
  483. }
  484. $at->__destruct();
  485. unset($at);
  486. }
  487. public function __destruct() {
  488. }
  489. public function validateAttributeForm($h = false) {
  490. $at = $this->getAttributeType();
  491. $at->controller->setAttributeKey($this);
  492. $e = true;
  493. if (method_exists($at->controller, 'validateForm')) {
  494. $e = $at->controller->validateForm($at->controller->post());
  495. }
  496. return $e;
  497. }
  498. public function createIndexedSearchTable() {
  499. if ($this->getIndexedSearchTable() != false) {
  500. $db = Loader::db();
  501. $dba = NewDataDictionary($db, DB_TYPE);
  502. $sqa = $dba->CreateTableSQL($this->getIndexedSearchTable(), $this->searchIndexFieldDefinition);
  503. $dba->ExecuteSQLArray($sqa);
  504. }
  505. }
  506. public function setAttributeSet($as) {
  507. if (!is_object($as)) {
  508. $as = AttributeSet::getByHandle($as);
  509. }
  510. $as->addKey($this);
  511. }
  512. public function clearAttributeSets() {
  513. $db = Loader::db();
  514. $db->Execute('delete from AttributeSetKeys where akID = ?', $this->akID);
  515. }
  516. public function getAttributeSets() {
  517. $db = Loader::db();
  518. $sets = array();
  519. $r = $db->Execute('select asID from AttributeSetKeys where akID = ?', $this->akID);
  520. while ($row = $r->FetchRow()) {
  521. $sets[] = AttributeSet::getByID($row['asID']);
  522. }
  523. return $sets;
  524. }
  525. /**
  526. * Saves an attribute using its stock form.
  527. */
  528. public function saveAttributeForm($obj) {
  529. $this->saveAttribute($obj);
  530. }
  531. /**
  532. * Sets an attribute directly with a passed value.
  533. */
  534. public function setAttribute($obj, $value) {
  535. $this->saveAttribute($obj, $value);
  536. }
  537. /**
  538. * @deprecated */
  539. public function outputSearchHTML() {
  540. $this->render('search');
  541. }
  542. // deprecated
  543. public function getKeyName() { return $this->getAttributeKeyName();}
  544. /**
  545. * Returns the handle for this attribute key
  546. */
  547. public function getKeyHandle() { return $this->getAttributeKeyHandle();}
  548. /**
  549. * Returns the ID for this attribute key
  550. */
  551. public function getKeyID() {return $this->getAttributeKeyID();}
  552. }