/build/classes/tugasku/om/BaseSiswaQuery.php

https://bitbucket.org/faisaluje/tugasku · PHP · 441 lines · 188 code · 26 blank · 227 comment · 28 complexity · e4af5d0f02a323c1bd48fe53b516adb2 MD5 · raw file

  1. <?php
  2. /**
  3. * Base class that represents a query for the 'siswa' table.
  4. *
  5. *
  6. *
  7. * @method SiswaQuery orderBySiswaId($order = Criteria::ASC) Order by the siswa_id column
  8. * @method SiswaQuery orderByNis($order = Criteria::ASC) Order by the nis column
  9. * @method SiswaQuery orderByNama($order = Criteria::ASC) Order by the nama column
  10. * @method SiswaQuery orderByJenisKelamin($order = Criteria::ASC) Order by the jenis_kelamin column
  11. * @method SiswaQuery orderByTempatLahir($order = Criteria::ASC) Order by the tempat_lahir column
  12. * @method SiswaQuery orderByTanggalLahir($order = Criteria::ASC) Order by the tanggal_lahir column
  13. * @method SiswaQuery orderByTelepon($order = Criteria::ASC) Order by the telepon column
  14. * @method SiswaQuery orderByKelas($order = Criteria::ASC) Order by the kelas column
  15. * @method SiswaQuery orderByFoto($order = Criteria::ASC) Order by the foto column
  16. *
  17. * @method SiswaQuery groupBySiswaId() Group by the siswa_id column
  18. * @method SiswaQuery groupByNis() Group by the nis column
  19. * @method SiswaQuery groupByNama() Group by the nama column
  20. * @method SiswaQuery groupByJenisKelamin() Group by the jenis_kelamin column
  21. * @method SiswaQuery groupByTempatLahir() Group by the tempat_lahir column
  22. * @method SiswaQuery groupByTanggalLahir() Group by the tanggal_lahir column
  23. * @method SiswaQuery groupByTelepon() Group by the telepon column
  24. * @method SiswaQuery groupByKelas() Group by the kelas column
  25. * @method SiswaQuery groupByFoto() Group by the foto column
  26. *
  27. * @method SiswaQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  28. * @method SiswaQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  29. * @method SiswaQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  30. *
  31. * @method SiswaQuery leftJoinTugas($relationAlias = null) Adds a LEFT JOIN clause to the query using the Tugas relation
  32. * @method SiswaQuery rightJoinTugas($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Tugas relation
  33. * @method SiswaQuery innerJoinTugas($relationAlias = null) Adds a INNER JOIN clause to the query using the Tugas relation
  34. *
  35. * @method Siswa findOne(PropelPDO $con = null) Return the first Siswa matching the query
  36. * @method Siswa findOneOrCreate(PropelPDO $con = null) Return the first Siswa matching the query, or a new Siswa object populated from the query conditions when no match is found
  37. *
  38. * @method Siswa findOneBySiswaId(int $siswa_id) Return the first Siswa filtered by the siswa_id column
  39. * @method Siswa findOneByNis(string $nis) Return the first Siswa filtered by the nis column
  40. * @method Siswa findOneByNama(string $nama) Return the first Siswa filtered by the nama column
  41. * @method Siswa findOneByJenisKelamin(string $jenis_kelamin) Return the first Siswa filtered by the jenis_kelamin column
  42. * @method Siswa findOneByTempatLahir(string $tempat_lahir) Return the first Siswa filtered by the tempat_lahir column
  43. * @method Siswa findOneByTanggalLahir(string $tanggal_lahir) Return the first Siswa filtered by the tanggal_lahir column
  44. * @method Siswa findOneByTelepon(string $telepon) Return the first Siswa filtered by the telepon column
  45. * @method Siswa findOneByKelas(string $kelas) Return the first Siswa filtered by the kelas column
  46. * @method Siswa findOneByFoto(string $foto) Return the first Siswa filtered by the foto column
  47. *
  48. * @method array findBySiswaId(int $siswa_id) Return Siswa objects filtered by the siswa_id column
  49. * @method array findByNis(string $nis) Return Siswa objects filtered by the nis column
  50. * @method array findByNama(string $nama) Return Siswa objects filtered by the nama column
  51. * @method array findByJenisKelamin(string $jenis_kelamin) Return Siswa objects filtered by the jenis_kelamin column
  52. * @method array findByTempatLahir(string $tempat_lahir) Return Siswa objects filtered by the tempat_lahir column
  53. * @method array findByTanggalLahir(string $tanggal_lahir) Return Siswa objects filtered by the tanggal_lahir column
  54. * @method array findByTelepon(string $telepon) Return Siswa objects filtered by the telepon column
  55. * @method array findByKelas(string $kelas) Return Siswa objects filtered by the kelas column
  56. * @method array findByFoto(string $foto) Return Siswa objects filtered by the foto column
  57. *
  58. * @package propel.generator.tugasku.om
  59. */
  60. abstract class BaseSiswaQuery extends ModelCriteria
  61. {
  62. /**
  63. * Initializes internal state of BaseSiswaQuery object.
  64. *
  65. * @param string $dbName The dabase name
  66. * @param string $modelName The phpName of a model, e.g. 'Book'
  67. * @param string $modelAlias The alias for the model in this query, e.g. 'b'
  68. */
  69. public function __construct($dbName = 'tugasku', $modelName = 'Siswa', $modelAlias = null)
  70. {
  71. parent::__construct($dbName, $modelName, $modelAlias);
  72. }
  73. /**
  74. * Returns a new SiswaQuery object.
  75. *
  76. * @param string $modelAlias The alias of a model in the query
  77. * @param Criteria $criteria Optional Criteria to build the query from
  78. *
  79. * @return SiswaQuery
  80. */
  81. public static function create($modelAlias = null, $criteria = null)
  82. {
  83. if ($criteria instanceof SiswaQuery) {
  84. return $criteria;
  85. }
  86. $query = new SiswaQuery();
  87. if (null !== $modelAlias) {
  88. $query->setModelAlias($modelAlias);
  89. }
  90. if ($criteria instanceof Criteria) {
  91. $query->mergeWith($criteria);
  92. }
  93. return $query;
  94. }
  95. /**
  96. * Find object by primary key
  97. * Use instance pooling to avoid a database query if the object exists
  98. * <code>
  99. * $obj = $c->findPk(12, $con);
  100. * </code>
  101. * @param mixed $key Primary key to use for the query
  102. * @param PropelPDO $con an optional connection object
  103. *
  104. * @return Siswa|array|mixed the result, formatted by the current formatter
  105. */
  106. public function findPk($key, $con = null)
  107. {
  108. if ((null !== ($obj = SiswaPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
  109. // the object is alredy in the instance pool
  110. return $obj;
  111. } else {
  112. // the object has not been requested yet, or the formatter is not an object formatter
  113. $criteria = $this->isKeepQuery() ? clone $this : $this;
  114. $stmt = $criteria
  115. ->filterByPrimaryKey($key)
  116. ->getSelectStatement($con);
  117. return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
  118. }
  119. }
  120. /**
  121. * Find objects by primary key
  122. * <code>
  123. * $objs = $c->findPks(array(12, 56, 832), $con);
  124. * </code>
  125. * @param array $keys Primary keys to use for the query
  126. * @param PropelPDO $con an optional connection object
  127. *
  128. * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
  129. */
  130. public function findPks($keys, $con = null)
  131. {
  132. $criteria = $this->isKeepQuery() ? clone $this : $this;
  133. return $this
  134. ->filterByPrimaryKeys($keys)
  135. ->find($con);
  136. }
  137. /**
  138. * Filter the query by primary key
  139. *
  140. * @param mixed $key Primary key to use for the query
  141. *
  142. * @return SiswaQuery The current query, for fluid interface
  143. */
  144. public function filterByPrimaryKey($key)
  145. {
  146. return $this->addUsingAlias(SiswaPeer::SISWA_ID, $key, Criteria::EQUAL);
  147. }
  148. /**
  149. * Filter the query by a list of primary keys
  150. *
  151. * @param array $keys The list of primary key to use for the query
  152. *
  153. * @return SiswaQuery The current query, for fluid interface
  154. */
  155. public function filterByPrimaryKeys($keys)
  156. {
  157. return $this->addUsingAlias(SiswaPeer::SISWA_ID, $keys, Criteria::IN);
  158. }
  159. /**
  160. * Filter the query on the siswa_id column
  161. *
  162. * @param int|array $siswaId The value to use as filter.
  163. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  164. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  165. *
  166. * @return SiswaQuery The current query, for fluid interface
  167. */
  168. public function filterBySiswaId($siswaId = null, $comparison = null)
  169. {
  170. if (is_array($siswaId) && null === $comparison) {
  171. $comparison = Criteria::IN;
  172. }
  173. return $this->addUsingAlias(SiswaPeer::SISWA_ID, $siswaId, $comparison);
  174. }
  175. /**
  176. * Filter the query on the nis column
  177. *
  178. * @param string $nis The value to use as filter.
  179. * Accepts wildcards (* and % trigger a LIKE)
  180. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  181. *
  182. * @return SiswaQuery The current query, for fluid interface
  183. */
  184. public function filterByNis($nis = null, $comparison = null)
  185. {
  186. if (null === $comparison) {
  187. if (is_array($nis)) {
  188. $comparison = Criteria::IN;
  189. } elseif (preg_match('/[\%\*]/', $nis)) {
  190. $nis = str_replace('*', '%', $nis);
  191. $comparison = Criteria::LIKE;
  192. }
  193. }
  194. return $this->addUsingAlias(SiswaPeer::NIS, $nis, $comparison);
  195. }
  196. /**
  197. * Filter the query on the nama column
  198. *
  199. * @param string $nama The value to use as filter.
  200. * Accepts wildcards (* and % trigger a LIKE)
  201. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  202. *
  203. * @return SiswaQuery The current query, for fluid interface
  204. */
  205. public function filterByNama($nama = null, $comparison = null)
  206. {
  207. if (null === $comparison) {
  208. if (is_array($nama)) {
  209. $comparison = Criteria::IN;
  210. } elseif (preg_match('/[\%\*]/', $nama)) {
  211. $nama = str_replace('*', '%', $nama);
  212. $comparison = Criteria::LIKE;
  213. }
  214. }
  215. return $this->addUsingAlias(SiswaPeer::NAMA, $nama, $comparison);
  216. }
  217. /**
  218. * Filter the query on the jenis_kelamin column
  219. *
  220. * @param string $jenisKelamin The value to use as filter.
  221. * Accepts wildcards (* and % trigger a LIKE)
  222. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  223. *
  224. * @return SiswaQuery The current query, for fluid interface
  225. */
  226. public function filterByJenisKelamin($jenisKelamin = null, $comparison = null)
  227. {
  228. if (null === $comparison) {
  229. if (is_array($jenisKelamin)) {
  230. $comparison = Criteria::IN;
  231. } elseif (preg_match('/[\%\*]/', $jenisKelamin)) {
  232. $jenisKelamin = str_replace('*', '%', $jenisKelamin);
  233. $comparison = Criteria::LIKE;
  234. }
  235. }
  236. return $this->addUsingAlias(SiswaPeer::JENIS_KELAMIN, $jenisKelamin, $comparison);
  237. }
  238. /**
  239. * Filter the query on the tempat_lahir column
  240. *
  241. * @param string $tempatLahir The value to use as filter.
  242. * Accepts wildcards (* and % trigger a LIKE)
  243. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  244. *
  245. * @return SiswaQuery The current query, for fluid interface
  246. */
  247. public function filterByTempatLahir($tempatLahir = null, $comparison = null)
  248. {
  249. if (null === $comparison) {
  250. if (is_array($tempatLahir)) {
  251. $comparison = Criteria::IN;
  252. } elseif (preg_match('/[\%\*]/', $tempatLahir)) {
  253. $tempatLahir = str_replace('*', '%', $tempatLahir);
  254. $comparison = Criteria::LIKE;
  255. }
  256. }
  257. return $this->addUsingAlias(SiswaPeer::TEMPAT_LAHIR, $tempatLahir, $comparison);
  258. }
  259. /**
  260. * Filter the query on the tanggal_lahir column
  261. *
  262. * @param string $tanggalLahir The value to use as filter.
  263. * Accepts wildcards (* and % trigger a LIKE)
  264. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  265. *
  266. * @return SiswaQuery The current query, for fluid interface
  267. */
  268. public function filterByTanggalLahir($tanggalLahir = null, $comparison = null)
  269. {
  270. if (null === $comparison) {
  271. if (is_array($tanggalLahir)) {
  272. $comparison = Criteria::IN;
  273. } elseif (preg_match('/[\%\*]/', $tanggalLahir)) {
  274. $tanggalLahir = str_replace('*', '%', $tanggalLahir);
  275. $comparison = Criteria::LIKE;
  276. }
  277. }
  278. return $this->addUsingAlias(SiswaPeer::TANGGAL_LAHIR, $tanggalLahir, $comparison);
  279. }
  280. /**
  281. * Filter the query on the telepon column
  282. *
  283. * @param string $telepon The value to use as filter.
  284. * Accepts wildcards (* and % trigger a LIKE)
  285. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  286. *
  287. * @return SiswaQuery The current query, for fluid interface
  288. */
  289. public function filterByTelepon($telepon = null, $comparison = null)
  290. {
  291. if (null === $comparison) {
  292. if (is_array($telepon)) {
  293. $comparison = Criteria::IN;
  294. } elseif (preg_match('/[\%\*]/', $telepon)) {
  295. $telepon = str_replace('*', '%', $telepon);
  296. $comparison = Criteria::LIKE;
  297. }
  298. }
  299. return $this->addUsingAlias(SiswaPeer::TELEPON, $telepon, $comparison);
  300. }
  301. /**
  302. * Filter the query on the kelas column
  303. *
  304. * @param string $kelas The value to use as filter.
  305. * Accepts wildcards (* and % trigger a LIKE)
  306. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  307. *
  308. * @return SiswaQuery The current query, for fluid interface
  309. */
  310. public function filterByKelas($kelas = null, $comparison = null)
  311. {
  312. if (null === $comparison) {
  313. if (is_array($kelas)) {
  314. $comparison = Criteria::IN;
  315. } elseif (preg_match('/[\%\*]/', $kelas)) {
  316. $kelas = str_replace('*', '%', $kelas);
  317. $comparison = Criteria::LIKE;
  318. }
  319. }
  320. return $this->addUsingAlias(SiswaPeer::KELAS, $kelas, $comparison);
  321. }
  322. /**
  323. * Filter the query on the foto column
  324. *
  325. * @param string $foto The value to use as filter.
  326. * Accepts wildcards (* and % trigger a LIKE)
  327. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  328. *
  329. * @return SiswaQuery The current query, for fluid interface
  330. */
  331. public function filterByFoto($foto = null, $comparison = null)
  332. {
  333. if (null === $comparison) {
  334. if (is_array($foto)) {
  335. $comparison = Criteria::IN;
  336. } elseif (preg_match('/[\%\*]/', $foto)) {
  337. $foto = str_replace('*', '%', $foto);
  338. $comparison = Criteria::LIKE;
  339. }
  340. }
  341. return $this->addUsingAlias(SiswaPeer::FOTO, $foto, $comparison);
  342. }
  343. /**
  344. * Filter the query by a related Tugas object
  345. *
  346. * @param Tugas $tugas the related object to use as filter
  347. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  348. *
  349. * @return SiswaQuery The current query, for fluid interface
  350. */
  351. public function filterByTugas($tugas, $comparison = null)
  352. {
  353. return $this
  354. ->addUsingAlias(SiswaPeer::NIS, $tugas->getNis(), $comparison);
  355. }
  356. /**
  357. * Adds a JOIN clause to the query using the Tugas relation
  358. *
  359. * @param string $relationAlias optional alias for the relation
  360. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  361. *
  362. * @return SiswaQuery The current query, for fluid interface
  363. */
  364. public function joinTugas($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  365. {
  366. $tableMap = $this->getTableMap();
  367. $relationMap = $tableMap->getRelation('Tugas');
  368. // create a ModelJoin object for this join
  369. $join = new ModelJoin();
  370. $join->setJoinType($joinType);
  371. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  372. if ($previousJoin = $this->getPreviousJoin()) {
  373. $join->setPreviousJoin($previousJoin);
  374. }
  375. // add the ModelJoin to the current object
  376. if($relationAlias) {
  377. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  378. $this->addJoinObject($join, $relationAlias);
  379. } else {
  380. $this->addJoinObject($join, 'Tugas');
  381. }
  382. return $this;
  383. }
  384. /**
  385. * Use the Tugas relation Tugas object
  386. *
  387. * @see useQuery()
  388. *
  389. * @param string $relationAlias optional alias for the relation,
  390. * to be used as main alias in the secondary query
  391. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  392. *
  393. * @return TugasQuery A secondary query class using the current class as primary query
  394. */
  395. public function useTugasQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  396. {
  397. return $this
  398. ->joinTugas($relationAlias, $joinType)
  399. ->useQuery($relationAlias ? $relationAlias : 'Tugas', 'TugasQuery');
  400. }
  401. /**
  402. * Exclude object from result
  403. *
  404. * @param Siswa $siswa Object to remove from the list of results
  405. *
  406. * @return SiswaQuery The current query, for fluid interface
  407. */
  408. public function prune($siswa = null)
  409. {
  410. if ($siswa) {
  411. $this->addUsingAlias(SiswaPeer::SISWA_ID, $siswa->getSiswaId(), Criteria::NOT_EQUAL);
  412. }
  413. return $this;
  414. }
  415. } // BaseSiswaQuery