/build/classes/tugasku/om/BaseTugasQuery.php

https://bitbucket.org/faisaluje/tugasku · PHP · 672 lines · 302 code · 44 blank · 326 comment · 46 complexity · 94d2058f0220ff0c03c200dd884538c6 MD5 · raw file

  1. <?php
  2. /**
  3. * Base class that represents a query for the 'tugas' table.
  4. *
  5. *
  6. *
  7. * @method TugasQuery orderByTugasId($order = Criteria::ASC) Order by the tugas_id column
  8. * @method TugasQuery orderByJenisTugasId($order = Criteria::ASC) Order by the jenis_tugas_id column
  9. * @method TugasQuery orderByMataPelajaranId($order = Criteria::ASC) Order by the mata_pelajaran_id column
  10. * @method TugasQuery orderByNis($order = Criteria::ASC) Order by the nis column
  11. * @method TugasQuery orderByTanggalPengumpulan($order = Criteria::ASC) Order by the tanggal_pengumpulan column
  12. * @method TugasQuery orderByNama($order = Criteria::ASC) Order by the nama column
  13. * @method TugasQuery orderByFile($order = Criteria::ASC) Order by the file column
  14. * @method TugasQuery orderByAbstrak($order = Criteria::ASC) Order by the abstrak column
  15. * @method TugasQuery orderByPenggunaId($order = Criteria::ASC) Order by the pengguna_id column
  16. *
  17. * @method TugasQuery groupByTugasId() Group by the tugas_id column
  18. * @method TugasQuery groupByJenisTugasId() Group by the jenis_tugas_id column
  19. * @method TugasQuery groupByMataPelajaranId() Group by the mata_pelajaran_id column
  20. * @method TugasQuery groupByNis() Group by the nis column
  21. * @method TugasQuery groupByTanggalPengumpulan() Group by the tanggal_pengumpulan column
  22. * @method TugasQuery groupByNama() Group by the nama column
  23. * @method TugasQuery groupByFile() Group by the file column
  24. * @method TugasQuery groupByAbstrak() Group by the abstrak column
  25. * @method TugasQuery groupByPenggunaId() Group by the pengguna_id column
  26. *
  27. * @method TugasQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  28. * @method TugasQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  29. * @method TugasQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  30. *
  31. * @method TugasQuery leftJoinJenisTugas($relationAlias = null) Adds a LEFT JOIN clause to the query using the JenisTugas relation
  32. * @method TugasQuery rightJoinJenisTugas($relationAlias = null) Adds a RIGHT JOIN clause to the query using the JenisTugas relation
  33. * @method TugasQuery innerJoinJenisTugas($relationAlias = null) Adds a INNER JOIN clause to the query using the JenisTugas relation
  34. *
  35. * @method TugasQuery leftJoinMataPelajaran($relationAlias = null) Adds a LEFT JOIN clause to the query using the MataPelajaran relation
  36. * @method TugasQuery rightJoinMataPelajaran($relationAlias = null) Adds a RIGHT JOIN clause to the query using the MataPelajaran relation
  37. * @method TugasQuery innerJoinMataPelajaran($relationAlias = null) Adds a INNER JOIN clause to the query using the MataPelajaran relation
  38. *
  39. * @method TugasQuery leftJoinSiswa($relationAlias = null) Adds a LEFT JOIN clause to the query using the Siswa relation
  40. * @method TugasQuery rightJoinSiswa($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Siswa relation
  41. * @method TugasQuery innerJoinSiswa($relationAlias = null) Adds a INNER JOIN clause to the query using the Siswa relation
  42. *
  43. * @method TugasQuery leftJoinPengguna($relationAlias = null) Adds a LEFT JOIN clause to the query using the Pengguna relation
  44. * @method TugasQuery rightJoinPengguna($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Pengguna relation
  45. * @method TugasQuery innerJoinPengguna($relationAlias = null) Adds a INNER JOIN clause to the query using the Pengguna relation
  46. *
  47. * @method Tugas findOne(PropelPDO $con = null) Return the first Tugas matching the query
  48. * @method Tugas findOneOrCreate(PropelPDO $con = null) Return the first Tugas matching the query, or a new Tugas object populated from the query conditions when no match is found
  49. *
  50. * @method Tugas findOneByTugasId(int $tugas_id) Return the first Tugas filtered by the tugas_id column
  51. * @method Tugas findOneByJenisTugasId(int $jenis_tugas_id) Return the first Tugas filtered by the jenis_tugas_id column
  52. * @method Tugas findOneByMataPelajaranId(int $mata_pelajaran_id) Return the first Tugas filtered by the mata_pelajaran_id column
  53. * @method Tugas findOneByNis(string $nis) Return the first Tugas filtered by the nis column
  54. * @method Tugas findOneByTanggalPengumpulan(string $tanggal_pengumpulan) Return the first Tugas filtered by the tanggal_pengumpulan column
  55. * @method Tugas findOneByNama(string $nama) Return the first Tugas filtered by the nama column
  56. * @method Tugas findOneByFile(string $file) Return the first Tugas filtered by the file column
  57. * @method Tugas findOneByAbstrak(string $abstrak) Return the first Tugas filtered by the abstrak column
  58. * @method Tugas findOneByPenggunaId(int $pengguna_id) Return the first Tugas filtered by the pengguna_id column
  59. *
  60. * @method array findByTugasId(int $tugas_id) Return Tugas objects filtered by the tugas_id column
  61. * @method array findByJenisTugasId(int $jenis_tugas_id) Return Tugas objects filtered by the jenis_tugas_id column
  62. * @method array findByMataPelajaranId(int $mata_pelajaran_id) Return Tugas objects filtered by the mata_pelajaran_id column
  63. * @method array findByNis(string $nis) Return Tugas objects filtered by the nis column
  64. * @method array findByTanggalPengumpulan(string $tanggal_pengumpulan) Return Tugas objects filtered by the tanggal_pengumpulan column
  65. * @method array findByNama(string $nama) Return Tugas objects filtered by the nama column
  66. * @method array findByFile(string $file) Return Tugas objects filtered by the file column
  67. * @method array findByAbstrak(string $abstrak) Return Tugas objects filtered by the abstrak column
  68. * @method array findByPenggunaId(int $pengguna_id) Return Tugas objects filtered by the pengguna_id column
  69. *
  70. * @package propel.generator.tugasku.om
  71. */
  72. abstract class BaseTugasQuery extends ModelCriteria
  73. {
  74. /**
  75. * Initializes internal state of BaseTugasQuery object.
  76. *
  77. * @param string $dbName The dabase name
  78. * @param string $modelName The phpName of a model, e.g. 'Book'
  79. * @param string $modelAlias The alias for the model in this query, e.g. 'b'
  80. */
  81. public function __construct($dbName = 'tugasku', $modelName = 'Tugas', $modelAlias = null)
  82. {
  83. parent::__construct($dbName, $modelName, $modelAlias);
  84. }
  85. /**
  86. * Returns a new TugasQuery object.
  87. *
  88. * @param string $modelAlias The alias of a model in the query
  89. * @param Criteria $criteria Optional Criteria to build the query from
  90. *
  91. * @return TugasQuery
  92. */
  93. public static function create($modelAlias = null, $criteria = null)
  94. {
  95. if ($criteria instanceof TugasQuery) {
  96. return $criteria;
  97. }
  98. $query = new TugasQuery();
  99. if (null !== $modelAlias) {
  100. $query->setModelAlias($modelAlias);
  101. }
  102. if ($criteria instanceof Criteria) {
  103. $query->mergeWith($criteria);
  104. }
  105. return $query;
  106. }
  107. /**
  108. * Find object by primary key
  109. * Use instance pooling to avoid a database query if the object exists
  110. * <code>
  111. * $obj = $c->findPk(12, $con);
  112. * </code>
  113. * @param mixed $key Primary key to use for the query
  114. * @param PropelPDO $con an optional connection object
  115. *
  116. * @return Tugas|array|mixed the result, formatted by the current formatter
  117. */
  118. public function findPk($key, $con = null)
  119. {
  120. if ((null !== ($obj = TugasPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
  121. // the object is alredy in the instance pool
  122. return $obj;
  123. } else {
  124. // the object has not been requested yet, or the formatter is not an object formatter
  125. $criteria = $this->isKeepQuery() ? clone $this : $this;
  126. $stmt = $criteria
  127. ->filterByPrimaryKey($key)
  128. ->getSelectStatement($con);
  129. return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
  130. }
  131. }
  132. /**
  133. * Find objects by primary key
  134. * <code>
  135. * $objs = $c->findPks(array(12, 56, 832), $con);
  136. * </code>
  137. * @param array $keys Primary keys to use for the query
  138. * @param PropelPDO $con an optional connection object
  139. *
  140. * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
  141. */
  142. public function findPks($keys, $con = null)
  143. {
  144. $criteria = $this->isKeepQuery() ? clone $this : $this;
  145. return $this
  146. ->filterByPrimaryKeys($keys)
  147. ->find($con);
  148. }
  149. /**
  150. * Filter the query by primary key
  151. *
  152. * @param mixed $key Primary key to use for the query
  153. *
  154. * @return TugasQuery The current query, for fluid interface
  155. */
  156. public function filterByPrimaryKey($key)
  157. {
  158. return $this->addUsingAlias(TugasPeer::TUGAS_ID, $key, Criteria::EQUAL);
  159. }
  160. /**
  161. * Filter the query by a list of primary keys
  162. *
  163. * @param array $keys The list of primary key to use for the query
  164. *
  165. * @return TugasQuery The current query, for fluid interface
  166. */
  167. public function filterByPrimaryKeys($keys)
  168. {
  169. return $this->addUsingAlias(TugasPeer::TUGAS_ID, $keys, Criteria::IN);
  170. }
  171. /**
  172. * Filter the query on the tugas_id column
  173. *
  174. * @param int|array $tugasId The value to use as filter.
  175. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  176. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  177. *
  178. * @return TugasQuery The current query, for fluid interface
  179. */
  180. public function filterByTugasId($tugasId = null, $comparison = null)
  181. {
  182. if (is_array($tugasId) && null === $comparison) {
  183. $comparison = Criteria::IN;
  184. }
  185. return $this->addUsingAlias(TugasPeer::TUGAS_ID, $tugasId, $comparison);
  186. }
  187. /**
  188. * Filter the query on the jenis_tugas_id column
  189. *
  190. * @param int|array $jenisTugasId The value to use as filter.
  191. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  192. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  193. *
  194. * @return TugasQuery The current query, for fluid interface
  195. */
  196. public function filterByJenisTugasId($jenisTugasId = null, $comparison = null)
  197. {
  198. if (is_array($jenisTugasId)) {
  199. $useMinMax = false;
  200. if (isset($jenisTugasId['min'])) {
  201. $this->addUsingAlias(TugasPeer::JENIS_TUGAS_ID, $jenisTugasId['min'], Criteria::GREATER_EQUAL);
  202. $useMinMax = true;
  203. }
  204. if (isset($jenisTugasId['max'])) {
  205. $this->addUsingAlias(TugasPeer::JENIS_TUGAS_ID, $jenisTugasId['max'], Criteria::LESS_EQUAL);
  206. $useMinMax = true;
  207. }
  208. if ($useMinMax) {
  209. return $this;
  210. }
  211. if (null === $comparison) {
  212. $comparison = Criteria::IN;
  213. }
  214. }
  215. return $this->addUsingAlias(TugasPeer::JENIS_TUGAS_ID, $jenisTugasId, $comparison);
  216. }
  217. /**
  218. * Filter the query on the mata_pelajaran_id column
  219. *
  220. * @param int|array $mataPelajaranId The value to use as filter.
  221. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  222. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  223. *
  224. * @return TugasQuery The current query, for fluid interface
  225. */
  226. public function filterByMataPelajaranId($mataPelajaranId = null, $comparison = null)
  227. {
  228. if (is_array($mataPelajaranId)) {
  229. $useMinMax = false;
  230. if (isset($mataPelajaranId['min'])) {
  231. $this->addUsingAlias(TugasPeer::MATA_PELAJARAN_ID, $mataPelajaranId['min'], Criteria::GREATER_EQUAL);
  232. $useMinMax = true;
  233. }
  234. if (isset($mataPelajaranId['max'])) {
  235. $this->addUsingAlias(TugasPeer::MATA_PELAJARAN_ID, $mataPelajaranId['max'], Criteria::LESS_EQUAL);
  236. $useMinMax = true;
  237. }
  238. if ($useMinMax) {
  239. return $this;
  240. }
  241. if (null === $comparison) {
  242. $comparison = Criteria::IN;
  243. }
  244. }
  245. return $this->addUsingAlias(TugasPeer::MATA_PELAJARAN_ID, $mataPelajaranId, $comparison);
  246. }
  247. /**
  248. * Filter the query on the nis column
  249. *
  250. * @param string $nis The value to use as filter.
  251. * Accepts wildcards (* and % trigger a LIKE)
  252. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  253. *
  254. * @return TugasQuery The current query, for fluid interface
  255. */
  256. public function filterByNis($nis = null, $comparison = null)
  257. {
  258. if (null === $comparison) {
  259. if (is_array($nis)) {
  260. $comparison = Criteria::IN;
  261. } elseif (preg_match('/[\%\*]/', $nis)) {
  262. $nis = str_replace('*', '%', $nis);
  263. $comparison = Criteria::LIKE;
  264. }
  265. }
  266. return $this->addUsingAlias(TugasPeer::NIS, $nis, $comparison);
  267. }
  268. /**
  269. * Filter the query on the tanggal_pengumpulan column
  270. *
  271. * @param string $tanggalPengumpulan The value to use as filter.
  272. * Accepts wildcards (* and % trigger a LIKE)
  273. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  274. *
  275. * @return TugasQuery The current query, for fluid interface
  276. */
  277. public function filterByTanggalPengumpulan($tanggalPengumpulan = null, $comparison = null)
  278. {
  279. if (null === $comparison) {
  280. if (is_array($tanggalPengumpulan)) {
  281. $comparison = Criteria::IN;
  282. } elseif (preg_match('/[\%\*]/', $tanggalPengumpulan)) {
  283. $tanggalPengumpulan = str_replace('*', '%', $tanggalPengumpulan);
  284. $comparison = Criteria::LIKE;
  285. }
  286. }
  287. return $this->addUsingAlias(TugasPeer::TANGGAL_PENGUMPULAN, $tanggalPengumpulan, $comparison);
  288. }
  289. /**
  290. * Filter the query on the nama column
  291. *
  292. * @param string $nama The value to use as filter.
  293. * Accepts wildcards (* and % trigger a LIKE)
  294. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  295. *
  296. * @return TugasQuery The current query, for fluid interface
  297. */
  298. public function filterByNama($nama = null, $comparison = null)
  299. {
  300. if (null === $comparison) {
  301. if (is_array($nama)) {
  302. $comparison = Criteria::IN;
  303. } elseif (preg_match('/[\%\*]/', $nama)) {
  304. $nama = str_replace('*', '%', $nama);
  305. $comparison = Criteria::LIKE;
  306. }
  307. }
  308. return $this->addUsingAlias(TugasPeer::NAMA, $nama, $comparison);
  309. }
  310. /**
  311. * Filter the query on the file column
  312. *
  313. * @param string $file The value to use as filter.
  314. * Accepts wildcards (* and % trigger a LIKE)
  315. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  316. *
  317. * @return TugasQuery The current query, for fluid interface
  318. */
  319. public function filterByFile($file = null, $comparison = null)
  320. {
  321. if (null === $comparison) {
  322. if (is_array($file)) {
  323. $comparison = Criteria::IN;
  324. } elseif (preg_match('/[\%\*]/', $file)) {
  325. $file = str_replace('*', '%', $file);
  326. $comparison = Criteria::LIKE;
  327. }
  328. }
  329. return $this->addUsingAlias(TugasPeer::FILE, $file, $comparison);
  330. }
  331. /**
  332. * Filter the query on the abstrak column
  333. *
  334. * @param string $abstrak The value to use as filter.
  335. * Accepts wildcards (* and % trigger a LIKE)
  336. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  337. *
  338. * @return TugasQuery The current query, for fluid interface
  339. */
  340. public function filterByAbstrak($abstrak = null, $comparison = null)
  341. {
  342. if (null === $comparison) {
  343. if (is_array($abstrak)) {
  344. $comparison = Criteria::IN;
  345. } elseif (preg_match('/[\%\*]/', $abstrak)) {
  346. $abstrak = str_replace('*', '%', $abstrak);
  347. $comparison = Criteria::LIKE;
  348. }
  349. }
  350. return $this->addUsingAlias(TugasPeer::ABSTRAK, $abstrak, $comparison);
  351. }
  352. /**
  353. * Filter the query on the pengguna_id column
  354. *
  355. * @param int|array $penggunaId The value to use as filter.
  356. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  357. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  358. *
  359. * @return TugasQuery The current query, for fluid interface
  360. */
  361. public function filterByPenggunaId($penggunaId = null, $comparison = null)
  362. {
  363. if (is_array($penggunaId)) {
  364. $useMinMax = false;
  365. if (isset($penggunaId['min'])) {
  366. $this->addUsingAlias(TugasPeer::PENGGUNA_ID, $penggunaId['min'], Criteria::GREATER_EQUAL);
  367. $useMinMax = true;
  368. }
  369. if (isset($penggunaId['max'])) {
  370. $this->addUsingAlias(TugasPeer::PENGGUNA_ID, $penggunaId['max'], Criteria::LESS_EQUAL);
  371. $useMinMax = true;
  372. }
  373. if ($useMinMax) {
  374. return $this;
  375. }
  376. if (null === $comparison) {
  377. $comparison = Criteria::IN;
  378. }
  379. }
  380. return $this->addUsingAlias(TugasPeer::PENGGUNA_ID, $penggunaId, $comparison);
  381. }
  382. /**
  383. * Filter the query by a related JenisTugas object
  384. *
  385. * @param JenisTugas $jenisTugas the related object to use as filter
  386. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  387. *
  388. * @return TugasQuery The current query, for fluid interface
  389. */
  390. public function filterByJenisTugas($jenisTugas, $comparison = null)
  391. {
  392. return $this
  393. ->addUsingAlias(TugasPeer::JENIS_TUGAS_ID, $jenisTugas->getJenisTugasId(), $comparison);
  394. }
  395. /**
  396. * Adds a JOIN clause to the query using the JenisTugas relation
  397. *
  398. * @param string $relationAlias optional alias for the relation
  399. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  400. *
  401. * @return TugasQuery The current query, for fluid interface
  402. */
  403. public function joinJenisTugas($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  404. {
  405. $tableMap = $this->getTableMap();
  406. $relationMap = $tableMap->getRelation('JenisTugas');
  407. // create a ModelJoin object for this join
  408. $join = new ModelJoin();
  409. $join->setJoinType($joinType);
  410. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  411. if ($previousJoin = $this->getPreviousJoin()) {
  412. $join->setPreviousJoin($previousJoin);
  413. }
  414. // add the ModelJoin to the current object
  415. if($relationAlias) {
  416. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  417. $this->addJoinObject($join, $relationAlias);
  418. } else {
  419. $this->addJoinObject($join, 'JenisTugas');
  420. }
  421. return $this;
  422. }
  423. /**
  424. * Use the JenisTugas relation JenisTugas object
  425. *
  426. * @see useQuery()
  427. *
  428. * @param string $relationAlias optional alias for the relation,
  429. * to be used as main alias in the secondary query
  430. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  431. *
  432. * @return JenisTugasQuery A secondary query class using the current class as primary query
  433. */
  434. public function useJenisTugasQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  435. {
  436. return $this
  437. ->joinJenisTugas($relationAlias, $joinType)
  438. ->useQuery($relationAlias ? $relationAlias : 'JenisTugas', 'JenisTugasQuery');
  439. }
  440. /**
  441. * Filter the query by a related MataPelajaran object
  442. *
  443. * @param MataPelajaran $mataPelajaran the related object to use as filter
  444. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  445. *
  446. * @return TugasQuery The current query, for fluid interface
  447. */
  448. public function filterByMataPelajaran($mataPelajaran, $comparison = null)
  449. {
  450. return $this
  451. ->addUsingAlias(TugasPeer::MATA_PELAJARAN_ID, $mataPelajaran->getMataPelajaranId(), $comparison);
  452. }
  453. /**
  454. * Adds a JOIN clause to the query using the MataPelajaran relation
  455. *
  456. * @param string $relationAlias optional alias for the relation
  457. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  458. *
  459. * @return TugasQuery The current query, for fluid interface
  460. */
  461. public function joinMataPelajaran($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  462. {
  463. $tableMap = $this->getTableMap();
  464. $relationMap = $tableMap->getRelation('MataPelajaran');
  465. // create a ModelJoin object for this join
  466. $join = new ModelJoin();
  467. $join->setJoinType($joinType);
  468. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  469. if ($previousJoin = $this->getPreviousJoin()) {
  470. $join->setPreviousJoin($previousJoin);
  471. }
  472. // add the ModelJoin to the current object
  473. if($relationAlias) {
  474. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  475. $this->addJoinObject($join, $relationAlias);
  476. } else {
  477. $this->addJoinObject($join, 'MataPelajaran');
  478. }
  479. return $this;
  480. }
  481. /**
  482. * Use the MataPelajaran relation MataPelajaran object
  483. *
  484. * @see useQuery()
  485. *
  486. * @param string $relationAlias optional alias for the relation,
  487. * to be used as main alias in the secondary query
  488. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  489. *
  490. * @return MataPelajaranQuery A secondary query class using the current class as primary query
  491. */
  492. public function useMataPelajaranQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  493. {
  494. return $this
  495. ->joinMataPelajaran($relationAlias, $joinType)
  496. ->useQuery($relationAlias ? $relationAlias : 'MataPelajaran', 'MataPelajaranQuery');
  497. }
  498. /**
  499. * Filter the query by a related Siswa object
  500. *
  501. * @param Siswa $siswa the related object to use as filter
  502. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  503. *
  504. * @return TugasQuery The current query, for fluid interface
  505. */
  506. public function filterBySiswa($siswa, $comparison = null)
  507. {
  508. return $this
  509. ->addUsingAlias(TugasPeer::NIS, $siswa->getNis(), $comparison);
  510. }
  511. /**
  512. * Adds a JOIN clause to the query using the Siswa relation
  513. *
  514. * @param string $relationAlias optional alias for the relation
  515. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  516. *
  517. * @return TugasQuery The current query, for fluid interface
  518. */
  519. public function joinSiswa($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  520. {
  521. $tableMap = $this->getTableMap();
  522. $relationMap = $tableMap->getRelation('Siswa');
  523. // create a ModelJoin object for this join
  524. $join = new ModelJoin();
  525. $join->setJoinType($joinType);
  526. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  527. if ($previousJoin = $this->getPreviousJoin()) {
  528. $join->setPreviousJoin($previousJoin);
  529. }
  530. // add the ModelJoin to the current object
  531. if($relationAlias) {
  532. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  533. $this->addJoinObject($join, $relationAlias);
  534. } else {
  535. $this->addJoinObject($join, 'Siswa');
  536. }
  537. return $this;
  538. }
  539. /**
  540. * Use the Siswa relation Siswa object
  541. *
  542. * @see useQuery()
  543. *
  544. * @param string $relationAlias optional alias for the relation,
  545. * to be used as main alias in the secondary query
  546. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  547. *
  548. * @return SiswaQuery A secondary query class using the current class as primary query
  549. */
  550. public function useSiswaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  551. {
  552. return $this
  553. ->joinSiswa($relationAlias, $joinType)
  554. ->useQuery($relationAlias ? $relationAlias : 'Siswa', 'SiswaQuery');
  555. }
  556. /**
  557. * Filter the query by a related Pengguna object
  558. *
  559. * @param Pengguna $pengguna the related object to use as filter
  560. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  561. *
  562. * @return TugasQuery The current query, for fluid interface
  563. */
  564. public function filterByPengguna($pengguna, $comparison = null)
  565. {
  566. return $this
  567. ->addUsingAlias(TugasPeer::PENGGUNA_ID, $pengguna->getPenggunaId(), $comparison);
  568. }
  569. /**
  570. * Adds a JOIN clause to the query using the Pengguna relation
  571. *
  572. * @param string $relationAlias optional alias for the relation
  573. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  574. *
  575. * @return TugasQuery The current query, for fluid interface
  576. */
  577. public function joinPengguna($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  578. {
  579. $tableMap = $this->getTableMap();
  580. $relationMap = $tableMap->getRelation('Pengguna');
  581. // create a ModelJoin object for this join
  582. $join = new ModelJoin();
  583. $join->setJoinType($joinType);
  584. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  585. if ($previousJoin = $this->getPreviousJoin()) {
  586. $join->setPreviousJoin($previousJoin);
  587. }
  588. // add the ModelJoin to the current object
  589. if($relationAlias) {
  590. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  591. $this->addJoinObject($join, $relationAlias);
  592. } else {
  593. $this->addJoinObject($join, 'Pengguna');
  594. }
  595. return $this;
  596. }
  597. /**
  598. * Use the Pengguna relation Pengguna object
  599. *
  600. * @see useQuery()
  601. *
  602. * @param string $relationAlias optional alias for the relation,
  603. * to be used as main alias in the secondary query
  604. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  605. *
  606. * @return PenggunaQuery A secondary query class using the current class as primary query
  607. */
  608. public function usePenggunaQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  609. {
  610. return $this
  611. ->joinPengguna($relationAlias, $joinType)
  612. ->useQuery($relationAlias ? $relationAlias : 'Pengguna', 'PenggunaQuery');
  613. }
  614. /**
  615. * Exclude object from result
  616. *
  617. * @param Tugas $tugas Object to remove from the list of results
  618. *
  619. * @return TugasQuery The current query, for fluid interface
  620. */
  621. public function prune($tugas = null)
  622. {
  623. if ($tugas) {
  624. $this->addUsingAlias(TugasPeer::TUGAS_ID, $tugas->getTugasId(), Criteria::NOT_EQUAL);
  625. }
  626. return $this;
  627. }
  628. } // BaseTugasQuery