BaseKataoSupplierProductCategory.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. <?php
  2. /**
  3. * Base class that represents a row from the 'katao_supplier_product_category' table.
  4. *
  5. *
  6. *
  7. * @package lib.model.om
  8. */
  9. abstract class BaseKataoSupplierProductCategory extends BaseObject implements Persistent {
  10. /**
  11. * The Peer class.
  12. * Instance provides a convenient way of calling static methods on a class
  13. * that calling code may not be able to identify.
  14. * @var KataoSupplierProductCategoryPeer
  15. */
  16. protected static $peer;
  17. /**
  18. * The value for the katao_supplier_id field.
  19. * @var int
  20. */
  21. protected $katao_supplier_id;
  22. /**
  23. * The value for the katao_product_category_id field.
  24. * @var int
  25. */
  26. protected $katao_product_category_id;
  27. /**
  28. * @var KataoSupplier
  29. */
  30. protected $aKataoSupplier;
  31. /**
  32. * @var KataoProductCategory
  33. */
  34. protected $aKataoProductCategory;
  35. /**
  36. * Flag to prevent endless save loop, if this object is referenced
  37. * by another object which falls in this transaction.
  38. * @var boolean
  39. */
  40. protected $alreadyInSave = false;
  41. /**
  42. * Flag to prevent endless validation loop, if this object is referenced
  43. * by another object which falls in this transaction.
  44. * @var boolean
  45. */
  46. protected $alreadyInValidation = false;
  47. /**
  48. * Get the [katao_supplier_id] column value.
  49. *
  50. * @return int
  51. */
  52. public function getKataoSupplierId()
  53. {
  54. return $this->katao_supplier_id;
  55. }
  56. /**
  57. * Get the [katao_product_category_id] column value.
  58. *
  59. * @return int
  60. */
  61. public function getKataoProductCategoryId()
  62. {
  63. return $this->katao_product_category_id;
  64. }
  65. /**
  66. * Set the value of [katao_supplier_id] column.
  67. *
  68. * @param int $v new value
  69. * @return void
  70. */
  71. public function setKataoSupplierId($v)
  72. {
  73. // Since the native PHP type for this column is integer,
  74. // we will cast the input value to an int (if it is not).
  75. if ($v !== null && !is_int($v) && is_numeric($v)) {
  76. $v = (int) $v;
  77. }
  78. if ($this->katao_supplier_id !== $v) {
  79. $this->katao_supplier_id = $v;
  80. $this->modifiedColumns[] = KataoSupplierProductCategoryPeer::KATAO_SUPPLIER_ID;
  81. }
  82. if ($this->aKataoSupplier !== null && $this->aKataoSupplier->getId() !== $v) {
  83. $this->aKataoSupplier = null;
  84. }
  85. } // setKataoSupplierId()
  86. /**
  87. * Set the value of [katao_product_category_id] column.
  88. *
  89. * @param int $v new value
  90. * @return void
  91. */
  92. public function setKataoProductCategoryId($v)
  93. {
  94. // Since the native PHP type for this column is integer,
  95. // we will cast the input value to an int (if it is not).
  96. if ($v !== null && !is_int($v) && is_numeric($v)) {
  97. $v = (int) $v;
  98. }
  99. if ($this->katao_product_category_id !== $v) {
  100. $this->katao_product_category_id = $v;
  101. $this->modifiedColumns[] = KataoSupplierProductCategoryPeer::KATAO_PRODUCT_CATEGORY_ID;
  102. }
  103. if ($this->aKataoProductCategory !== null && $this->aKataoProductCategory->getId() !== $v) {
  104. $this->aKataoProductCategory = null;
  105. }
  106. } // setKataoProductCategoryId()
  107. /**
  108. * Hydrates (populates) the object variables with values from the database resultset.
  109. *
  110. * An offset (1-based "start column") is specified so that objects can be hydrated
  111. * with a subset of the columns in the resultset rows. This is needed, for example,
  112. * for results of JOIN queries where the resultset row includes columns from two or
  113. * more tables.
  114. *
  115. * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
  116. * @param int $startcol 1-based offset column which indicates which restultset column to start with.
  117. * @return int next starting column
  118. * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
  119. */
  120. public function hydrate(ResultSet $rs, $startcol = 1)
  121. {
  122. try {
  123. $this->katao_supplier_id = $rs->getInt($startcol + 0);
  124. $this->katao_product_category_id = $rs->getInt($startcol + 1);
  125. $this->resetModified();
  126. $this->setNew(false);
  127. // FIXME - using NUM_COLUMNS may be clearer.
  128. return $startcol + 2; // 2 = KataoSupplierProductCategoryPeer::NUM_COLUMNS - KataoSupplierProductCategoryPeer::NUM_LAZY_LOAD_COLUMNS).
  129. } catch (Exception $e) {
  130. throw new PropelException("Error populating KataoSupplierProductCategory object", $e);
  131. }
  132. }
  133. /**
  134. * Removes this object from datastore and sets delete attribute.
  135. *
  136. * @param Connection $con
  137. * @return void
  138. * @throws PropelException
  139. * @see BaseObject::setDeleted()
  140. * @see BaseObject::isDeleted()
  141. */
  142. public function delete($con = null)
  143. {
  144. foreach (sfMixer::getCallables('BaseKataoSupplierProductCategory:delete:pre') as $callable)
  145. {
  146. $ret = call_user_func($callable, $this, $con);
  147. if ($ret)
  148. {
  149. return;
  150. }
  151. }
  152. if ($this->isDeleted()) {
  153. throw new PropelException("This object has already been deleted.");
  154. }
  155. if ($con === null) {
  156. $con = Propel::getConnection(KataoSupplierProductCategoryPeer::DATABASE_NAME);
  157. }
  158. try {
  159. $con->begin();
  160. KataoSupplierProductCategoryPeer::doDelete($this, $con);
  161. $this->setDeleted(true);
  162. $con->commit();
  163. } catch (PropelException $e) {
  164. $con->rollback();
  165. throw $e;
  166. }
  167. foreach (sfMixer::getCallables('BaseKataoSupplierProductCategory:delete:post') as $callable)
  168. {
  169. call_user_func($callable, $this, $con);
  170. }
  171. }
  172. /**
  173. * Stores the object in the database. If the object is new,
  174. * it inserts it; otherwise an update is performed. This method
  175. * wraps the doSave() worker method in a transaction.
  176. *
  177. * @param Connection $con
  178. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  179. * @throws PropelException
  180. * @see doSave()
  181. */
  182. public function save($con = null)
  183. {
  184. foreach (sfMixer::getCallables('BaseKataoSupplierProductCategory:save:pre') as $callable)
  185. {
  186. $affectedRows = call_user_func($callable, $this, $con);
  187. if (is_int($affectedRows))
  188. {
  189. return $affectedRows;
  190. }
  191. }
  192. if ($this->isDeleted()) {
  193. throw new PropelException("You cannot save an object that has been deleted.");
  194. }
  195. if ($con === null) {
  196. $con = Propel::getConnection(KataoSupplierProductCategoryPeer::DATABASE_NAME);
  197. }
  198. try {
  199. $con->begin();
  200. $affectedRows = $this->doSave($con);
  201. $con->commit();
  202. foreach (sfMixer::getCallables('BaseKataoSupplierProductCategory:save:post') as $callable)
  203. {
  204. call_user_func($callable, $this, $con, $affectedRows);
  205. }
  206. return $affectedRows;
  207. } catch (PropelException $e) {
  208. $con->rollback();
  209. throw $e;
  210. }
  211. }
  212. /**
  213. * Stores the object in the database.
  214. *
  215. * If the object is new, it inserts it; otherwise an update is performed.
  216. * All related objects are also updated in this method.
  217. *
  218. * @param Connection $con
  219. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  220. * @throws PropelException
  221. * @see save()
  222. */
  223. protected function doSave($con)
  224. {
  225. $affectedRows = 0; // initialize var to track total num of affected rows
  226. if (!$this->alreadyInSave) {
  227. $this->alreadyInSave = true;
  228. // We call the save method on the following object(s) if they
  229. // were passed to this object by their coresponding set
  230. // method. This object relates to these object(s) by a
  231. // foreign key reference.
  232. if ($this->aKataoSupplier !== null) {
  233. if ($this->aKataoSupplier->isModified()) {
  234. $affectedRows += $this->aKataoSupplier->save($con);
  235. }
  236. $this->setKataoSupplier($this->aKataoSupplier);
  237. }
  238. if ($this->aKataoProductCategory !== null) {
  239. if ($this->aKataoProductCategory->isModified()) {
  240. $affectedRows += $this->aKataoProductCategory->save($con);
  241. }
  242. $this->setKataoProductCategory($this->aKataoProductCategory);
  243. }
  244. // If this object has been modified, then save it to the database.
  245. if ($this->isModified()) {
  246. if ($this->isNew()) {
  247. $pk = KataoSupplierProductCategoryPeer::doInsert($this, $con);
  248. $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
  249. // should always be true here (even though technically
  250. // BasePeer::doInsert() can insert multiple rows).
  251. $this->setNew(false);
  252. } else {
  253. $affectedRows += KataoSupplierProductCategoryPeer::doUpdate($this, $con);
  254. }
  255. $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
  256. }
  257. $this->alreadyInSave = false;
  258. }
  259. return $affectedRows;
  260. } // doSave()
  261. /**
  262. * Array of ValidationFailed objects.
  263. * @var array ValidationFailed[]
  264. */
  265. protected $validationFailures = array();
  266. /**
  267. * Gets any ValidationFailed objects that resulted from last call to validate().
  268. *
  269. *
  270. * @return array ValidationFailed[]
  271. * @see validate()
  272. */
  273. public function getValidationFailures()
  274. {
  275. return $this->validationFailures;
  276. }
  277. /**
  278. * Validates the objects modified field values and all objects related to this table.
  279. *
  280. * If $columns is either a column name or an array of column names
  281. * only those columns are validated.
  282. *
  283. * @param mixed $columns Column name or an array of column names.
  284. * @return boolean Whether all columns pass validation.
  285. * @see doValidate()
  286. * @see getValidationFailures()
  287. */
  288. public function validate($columns = null)
  289. {
  290. $res = $this->doValidate($columns);
  291. if ($res === true) {
  292. $this->validationFailures = array();
  293. return true;
  294. } else {
  295. $this->validationFailures = $res;
  296. return false;
  297. }
  298. }
  299. /**
  300. * This function performs the validation work for complex object models.
  301. *
  302. * In addition to checking the current object, all related objects will
  303. * also be validated. If all pass then <code>true</code> is returned; otherwise
  304. * an aggreagated array of ValidationFailed objects will be returned.
  305. *
  306. * @param array $columns Array of column names to validate.
  307. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  308. */
  309. protected function doValidate($columns = null)
  310. {
  311. if (!$this->alreadyInValidation) {
  312. $this->alreadyInValidation = true;
  313. $retval = null;
  314. $failureMap = array();
  315. // We call the validate method on the following object(s) if they
  316. // were passed to this object by their coresponding set
  317. // method. This object relates to these object(s) by a
  318. // foreign key reference.
  319. if ($this->aKataoSupplier !== null) {
  320. if (!$this->aKataoSupplier->validate($columns)) {
  321. $failureMap = array_merge($failureMap, $this->aKataoSupplier->getValidationFailures());
  322. }
  323. }
  324. if ($this->aKataoProductCategory !== null) {
  325. if (!$this->aKataoProductCategory->validate($columns)) {
  326. $failureMap = array_merge($failureMap, $this->aKataoProductCategory->getValidationFailures());
  327. }
  328. }
  329. if (($retval = KataoSupplierProductCategoryPeer::doValidate($this, $columns)) !== true) {
  330. $failureMap = array_merge($failureMap, $retval);
  331. }
  332. $this->alreadyInValidation = false;
  333. }
  334. return (!empty($failureMap) ? $failureMap : true);
  335. }
  336. /**
  337. * Retrieves a field from the object by name passed in as a string.
  338. *
  339. * @param string $name name
  340. * @param string $type The type of fieldname the $name is of:
  341. * one of the class type constants TYPE_PHPNAME,
  342. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  343. * @return mixed Value of field.
  344. */
  345. public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
  346. {
  347. $pos = KataoSupplierProductCategoryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  348. return $this->getByPosition($pos);
  349. }
  350. /**
  351. * Retrieves a field from the object by Position as specified in the xml schema.
  352. * Zero-based.
  353. *
  354. * @param int $pos position in xml schema
  355. * @return mixed Value of field at $pos
  356. */
  357. public function getByPosition($pos)
  358. {
  359. switch($pos) {
  360. case 0:
  361. return $this->getKataoSupplierId();
  362. break;
  363. case 1:
  364. return $this->getKataoProductCategoryId();
  365. break;
  366. default:
  367. return null;
  368. break;
  369. } // switch()
  370. }
  371. /**
  372. * Exports the object as an array.
  373. *
  374. * You can specify the key type of the array by passing one of the class
  375. * type constants.
  376. *
  377. * @param string $keyType One of the class type constants TYPE_PHPNAME,
  378. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  379. * @return an associative array containing the field names (as keys) and field values
  380. */
  381. public function toArray($keyType = BasePeer::TYPE_PHPNAME)
  382. {
  383. $keys = KataoSupplierProductCategoryPeer::getFieldNames($keyType);
  384. $result = array(
  385. $keys[0] => $this->getKataoSupplierId(),
  386. $keys[1] => $this->getKataoProductCategoryId(),
  387. );
  388. return $result;
  389. }
  390. /**
  391. * Sets a field from the object by name passed in as a string.
  392. *
  393. * @param string $name peer name
  394. * @param mixed $value field value
  395. * @param string $type The type of fieldname the $name is of:
  396. * one of the class type constants TYPE_PHPNAME,
  397. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  398. * @return void
  399. */
  400. public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
  401. {
  402. $pos = KataoSupplierProductCategoryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  403. return $this->setByPosition($pos, $value);
  404. }
  405. /**
  406. * Sets a field from the object by Position as specified in the xml schema.
  407. * Zero-based.
  408. *
  409. * @param int $pos position in xml schema
  410. * @param mixed $value field value
  411. * @return void
  412. */
  413. public function setByPosition($pos, $value)
  414. {
  415. switch($pos) {
  416. case 0:
  417. $this->setKataoSupplierId($value);
  418. break;
  419. case 1:
  420. $this->setKataoProductCategoryId($value);
  421. break;
  422. } // switch()
  423. }
  424. /**
  425. * Populates the object using an array.
  426. *
  427. * This is particularly useful when populating an object from one of the
  428. * request arrays (e.g. $_POST). This method goes through the column
  429. * names, checking to see whether a matching key exists in populated
  430. * array. If so the setByName() method is called for that column.
  431. *
  432. * You can specify the key type of the array by additionally passing one
  433. * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
  434. * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
  435. *
  436. * @param array $arr An array to populate the object from.
  437. * @param string $keyType The type of keys the array uses.
  438. * @return void
  439. */
  440. public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
  441. {
  442. $keys = KataoSupplierProductCategoryPeer::getFieldNames($keyType);
  443. if (array_key_exists($keys[0], $arr)) $this->setKataoSupplierId($arr[$keys[0]]);
  444. if (array_key_exists($keys[1], $arr)) $this->setKataoProductCategoryId($arr[$keys[1]]);
  445. }
  446. /**
  447. * Build a Criteria object containing the values of all modified columns in this object.
  448. *
  449. * @return Criteria The Criteria object containing all modified values.
  450. */
  451. public function buildCriteria()
  452. {
  453. $criteria = new Criteria(KataoSupplierProductCategoryPeer::DATABASE_NAME);
  454. if ($this->isColumnModified(KataoSupplierProductCategoryPeer::KATAO_SUPPLIER_ID)) $criteria->add(KataoSupplierProductCategoryPeer::KATAO_SUPPLIER_ID, $this->katao_supplier_id);
  455. if ($this->isColumnModified(KataoSupplierProductCategoryPeer::KATAO_PRODUCT_CATEGORY_ID)) $criteria->add(KataoSupplierProductCategoryPeer::KATAO_PRODUCT_CATEGORY_ID, $this->katao_product_category_id);
  456. return $criteria;
  457. }
  458. /**
  459. * Builds a Criteria object containing the primary key for this object.
  460. *
  461. * Unlike buildCriteria() this method includes the primary key values regardless
  462. * of whether or not they have been modified.
  463. *
  464. * @return Criteria The Criteria object containing value(s) for primary key(s).
  465. */
  466. public function buildPkeyCriteria()
  467. {
  468. $criteria = new Criteria(KataoSupplierProductCategoryPeer::DATABASE_NAME);
  469. $criteria->add(KataoSupplierProductCategoryPeer::KATAO_SUPPLIER_ID, $this->katao_supplier_id);
  470. $criteria->add(KataoSupplierProductCategoryPeer::KATAO_PRODUCT_CATEGORY_ID, $this->katao_product_category_id);
  471. return $criteria;
  472. }
  473. /**
  474. * Returns the composite primary key for this object.
  475. * The array elements will be in same order as specified in XML.
  476. * @return array
  477. */
  478. public function getPrimaryKey()
  479. {
  480. $pks = array();
  481. $pks[0] = $this->getKataoSupplierId();
  482. $pks[1] = $this->getKataoProductCategoryId();
  483. return $pks;
  484. }
  485. /**
  486. * Set the [composite] primary key.
  487. *
  488. * @param array $keys The elements of the composite key (order must match the order in XML file).
  489. * @return void
  490. */
  491. public function setPrimaryKey($keys)
  492. {
  493. $this->setKataoSupplierId($keys[0]);
  494. $this->setKataoProductCategoryId($keys[1]);
  495. }
  496. /**
  497. * Sets contents of passed object to values from current object.
  498. *
  499. * If desired, this method can also make copies of all associated (fkey referrers)
  500. * objects.
  501. *
  502. * @param object $copyObj An object of KataoSupplierProductCategory (or compatible) type.
  503. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  504. * @throws PropelException
  505. */
  506. public function copyInto($copyObj, $deepCopy = false)
  507. {
  508. $copyObj->setNew(true);
  509. $copyObj->setKataoSupplierId(NULL); // this is a pkey column, so set to default value
  510. $copyObj->setKataoProductCategoryId(NULL); // this is a pkey column, so set to default value
  511. }
  512. /**
  513. * Makes a copy of this object that will be inserted as a new row in table when saved.
  514. * It creates a new object filling in the simple attributes, but skipping any primary
  515. * keys that are defined for the table.
  516. *
  517. * If desired, this method can also make copies of all associated (fkey referrers)
  518. * objects.
  519. *
  520. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  521. * @return KataoSupplierProductCategory Clone of current object.
  522. * @throws PropelException
  523. */
  524. public function copy($deepCopy = false)
  525. {
  526. // we use get_class(), because this might be a subclass
  527. $clazz = get_class($this);
  528. $copyObj = new $clazz();
  529. $this->copyInto($copyObj, $deepCopy);
  530. return $copyObj;
  531. }
  532. /**
  533. * Returns a peer instance associated with this om.
  534. *
  535. * Since Peer classes are not to have any instance attributes, this method returns the
  536. * same instance for all member of this class. The method could therefore
  537. * be static, but this would prevent one from overriding the behavior.
  538. *
  539. * @return KataoSupplierProductCategoryPeer
  540. */
  541. public function getPeer()
  542. {
  543. if (self::$peer === null) {
  544. self::$peer = new KataoSupplierProductCategoryPeer();
  545. }
  546. return self::$peer;
  547. }
  548. /**
  549. * Declares an association between this object and a KataoSupplier object.
  550. *
  551. * @param KataoSupplier $v
  552. * @return void
  553. * @throws PropelException
  554. */
  555. public function setKataoSupplier($v)
  556. {
  557. if ($v === null) {
  558. $this->setKataoSupplierId(NULL);
  559. } else {
  560. $this->setKataoSupplierId($v->getId());
  561. }
  562. $this->aKataoSupplier = $v;
  563. }
  564. /**
  565. * Get the associated KataoSupplier object
  566. *
  567. * @param Connection Optional Connection object.
  568. * @return KataoSupplier The associated KataoSupplier object.
  569. * @throws PropelException
  570. */
  571. public function getKataoSupplier($con = null)
  572. {
  573. if ($this->aKataoSupplier === null && ($this->katao_supplier_id !== null)) {
  574. // include the related Peer class
  575. $this->aKataoSupplier = KataoSupplierPeer::retrieveByPK($this->katao_supplier_id, $con);
  576. /* The following can be used instead of the line above to
  577. guarantee the related object contains a reference
  578. to this object, but this level of coupling
  579. may be undesirable in many circumstances.
  580. As it can lead to a db query with many results that may
  581. never be used.
  582. $obj = KataoSupplierPeer::retrieveByPK($this->katao_supplier_id, $con);
  583. $obj->addKataoSuppliers($this);
  584. */
  585. }
  586. return $this->aKataoSupplier;
  587. }
  588. /**
  589. * Declares an association between this object and a KataoProductCategory object.
  590. *
  591. * @param KataoProductCategory $v
  592. * @return void
  593. * @throws PropelException
  594. */
  595. public function setKataoProductCategory($v)
  596. {
  597. if ($v === null) {
  598. $this->setKataoProductCategoryId(NULL);
  599. } else {
  600. $this->setKataoProductCategoryId($v->getId());
  601. }
  602. $this->aKataoProductCategory = $v;
  603. }
  604. /**
  605. * Get the associated KataoProductCategory object
  606. *
  607. * @param Connection Optional Connection object.
  608. * @return KataoProductCategory The associated KataoProductCategory object.
  609. * @throws PropelException
  610. */
  611. public function getKataoProductCategory($con = null)
  612. {
  613. if ($this->aKataoProductCategory === null && ($this->katao_product_category_id !== null)) {
  614. // include the related Peer class
  615. $this->aKataoProductCategory = KataoProductCategoryPeer::retrieveByPK($this->katao_product_category_id, $con);
  616. /* The following can be used instead of the line above to
  617. guarantee the related object contains a reference
  618. to this object, but this level of coupling
  619. may be undesirable in many circumstances.
  620. As it can lead to a db query with many results that may
  621. never be used.
  622. $obj = KataoProductCategoryPeer::retrieveByPK($this->katao_product_category_id, $con);
  623. $obj->addKataoProductCategorys($this);
  624. */
  625. }
  626. return $this->aKataoProductCategory;
  627. }
  628. public function __call($method, $arguments)
  629. {
  630. if (!$callable = sfMixer::getCallable('BaseKataoSupplierProductCategory:'.$method))
  631. {
  632. throw new sfException(sprintf('Call to undefined method BaseKataoSupplierProductCategory::%s', $method));
  633. }
  634. array_unshift($arguments, $this);
  635. return call_user_func_array($callable, $arguments);
  636. }
  637. } // BaseKataoSupplierProductCategory