/build/classes/tugasku/om/BaseMataPelajaranQuery.php

https://bitbucket.org/faisaluje/tugasku · PHP · 362 lines · 154 code · 26 blank · 182 comment · 22 complexity · f9f1fc246cc29bb1dbebcc6836b40066 MD5 · raw file

  1. <?php
  2. /**
  3. * Base class that represents a query for the 'mata_pelajaran' table.
  4. *
  5. *
  6. *
  7. * @method MataPelajaranQuery orderByMataPelajaranId($order = Criteria::ASC) Order by the mata_pelajaran_id column
  8. * @method MataPelajaranQuery orderByNama($order = Criteria::ASC) Order by the nama column
  9. * @method MataPelajaranQuery orderByKompetensiKeahlianId($order = Criteria::ASC) Order by the kompetensi_keahlian_id column
  10. *
  11. * @method MataPelajaranQuery groupByMataPelajaranId() Group by the mata_pelajaran_id column
  12. * @method MataPelajaranQuery groupByNama() Group by the nama column
  13. * @method MataPelajaranQuery groupByKompetensiKeahlianId() Group by the kompetensi_keahlian_id column
  14. *
  15. * @method MataPelajaranQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
  16. * @method MataPelajaranQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
  17. * @method MataPelajaranQuery innerJoin($relation) Adds a INNER JOIN clause to the query
  18. *
  19. * @method MataPelajaranQuery leftJoinKompetensiKeahlian($relationAlias = null) Adds a LEFT JOIN clause to the query using the KompetensiKeahlian relation
  20. * @method MataPelajaranQuery rightJoinKompetensiKeahlian($relationAlias = null) Adds a RIGHT JOIN clause to the query using the KompetensiKeahlian relation
  21. * @method MataPelajaranQuery innerJoinKompetensiKeahlian($relationAlias = null) Adds a INNER JOIN clause to the query using the KompetensiKeahlian relation
  22. *
  23. * @method MataPelajaranQuery leftJoinTugas($relationAlias = null) Adds a LEFT JOIN clause to the query using the Tugas relation
  24. * @method MataPelajaranQuery rightJoinTugas($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Tugas relation
  25. * @method MataPelajaranQuery innerJoinTugas($relationAlias = null) Adds a INNER JOIN clause to the query using the Tugas relation
  26. *
  27. * @method MataPelajaran findOne(PropelPDO $con = null) Return the first MataPelajaran matching the query
  28. * @method MataPelajaran findOneOrCreate(PropelPDO $con = null) Return the first MataPelajaran matching the query, or a new MataPelajaran object populated from the query conditions when no match is found
  29. *
  30. * @method MataPelajaran findOneByMataPelajaranId(int $mata_pelajaran_id) Return the first MataPelajaran filtered by the mata_pelajaran_id column
  31. * @method MataPelajaran findOneByNama(string $nama) Return the first MataPelajaran filtered by the nama column
  32. * @method MataPelajaran findOneByKompetensiKeahlianId(int $kompetensi_keahlian_id) Return the first MataPelajaran filtered by the kompetensi_keahlian_id column
  33. *
  34. * @method array findByMataPelajaranId(int $mata_pelajaran_id) Return MataPelajaran objects filtered by the mata_pelajaran_id column
  35. * @method array findByNama(string $nama) Return MataPelajaran objects filtered by the nama column
  36. * @method array findByKompetensiKeahlianId(int $kompetensi_keahlian_id) Return MataPelajaran objects filtered by the kompetensi_keahlian_id column
  37. *
  38. * @package propel.generator.tugasku.om
  39. */
  40. abstract class BaseMataPelajaranQuery extends ModelCriteria
  41. {
  42. /**
  43. * Initializes internal state of BaseMataPelajaranQuery object.
  44. *
  45. * @param string $dbName The dabase name
  46. * @param string $modelName The phpName of a model, e.g. 'Book'
  47. * @param string $modelAlias The alias for the model in this query, e.g. 'b'
  48. */
  49. public function __construct($dbName = 'tugasku', $modelName = 'MataPelajaran', $modelAlias = null)
  50. {
  51. parent::__construct($dbName, $modelName, $modelAlias);
  52. }
  53. /**
  54. * Returns a new MataPelajaranQuery object.
  55. *
  56. * @param string $modelAlias The alias of a model in the query
  57. * @param Criteria $criteria Optional Criteria to build the query from
  58. *
  59. * @return MataPelajaranQuery
  60. */
  61. public static function create($modelAlias = null, $criteria = null)
  62. {
  63. if ($criteria instanceof MataPelajaranQuery) {
  64. return $criteria;
  65. }
  66. $query = new MataPelajaranQuery();
  67. if (null !== $modelAlias) {
  68. $query->setModelAlias($modelAlias);
  69. }
  70. if ($criteria instanceof Criteria) {
  71. $query->mergeWith($criteria);
  72. }
  73. return $query;
  74. }
  75. /**
  76. * Find object by primary key
  77. * Use instance pooling to avoid a database query if the object exists
  78. * <code>
  79. * $obj = $c->findPk(12, $con);
  80. * </code>
  81. * @param mixed $key Primary key to use for the query
  82. * @param PropelPDO $con an optional connection object
  83. *
  84. * @return MataPelajaran|array|mixed the result, formatted by the current formatter
  85. */
  86. public function findPk($key, $con = null)
  87. {
  88. if ((null !== ($obj = MataPelajaranPeer::getInstanceFromPool((string) $key))) && $this->getFormatter()->isObjectFormatter()) {
  89. // the object is alredy in the instance pool
  90. return $obj;
  91. } else {
  92. // the object has not been requested yet, or the formatter is not an object formatter
  93. $criteria = $this->isKeepQuery() ? clone $this : $this;
  94. $stmt = $criteria
  95. ->filterByPrimaryKey($key)
  96. ->getSelectStatement($con);
  97. return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
  98. }
  99. }
  100. /**
  101. * Find objects by primary key
  102. * <code>
  103. * $objs = $c->findPks(array(12, 56, 832), $con);
  104. * </code>
  105. * @param array $keys Primary keys to use for the query
  106. * @param PropelPDO $con an optional connection object
  107. *
  108. * @return PropelObjectCollection|array|mixed the list of results, formatted by the current formatter
  109. */
  110. public function findPks($keys, $con = null)
  111. {
  112. $criteria = $this->isKeepQuery() ? clone $this : $this;
  113. return $this
  114. ->filterByPrimaryKeys($keys)
  115. ->find($con);
  116. }
  117. /**
  118. * Filter the query by primary key
  119. *
  120. * @param mixed $key Primary key to use for the query
  121. *
  122. * @return MataPelajaranQuery The current query, for fluid interface
  123. */
  124. public function filterByPrimaryKey($key)
  125. {
  126. return $this->addUsingAlias(MataPelajaranPeer::MATA_PELAJARAN_ID, $key, Criteria::EQUAL);
  127. }
  128. /**
  129. * Filter the query by a list of primary keys
  130. *
  131. * @param array $keys The list of primary key to use for the query
  132. *
  133. * @return MataPelajaranQuery The current query, for fluid interface
  134. */
  135. public function filterByPrimaryKeys($keys)
  136. {
  137. return $this->addUsingAlias(MataPelajaranPeer::MATA_PELAJARAN_ID, $keys, Criteria::IN);
  138. }
  139. /**
  140. * Filter the query on the mata_pelajaran_id column
  141. *
  142. * @param int|array $mataPelajaranId The value to use as filter.
  143. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  144. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  145. *
  146. * @return MataPelajaranQuery The current query, for fluid interface
  147. */
  148. public function filterByMataPelajaranId($mataPelajaranId = null, $comparison = null)
  149. {
  150. if (is_array($mataPelajaranId) && null === $comparison) {
  151. $comparison = Criteria::IN;
  152. }
  153. return $this->addUsingAlias(MataPelajaranPeer::MATA_PELAJARAN_ID, $mataPelajaranId, $comparison);
  154. }
  155. /**
  156. * Filter the query on the nama column
  157. *
  158. * @param string $nama The value to use as filter.
  159. * Accepts wildcards (* and % trigger a LIKE)
  160. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  161. *
  162. * @return MataPelajaranQuery The current query, for fluid interface
  163. */
  164. public function filterByNama($nama = null, $comparison = null)
  165. {
  166. if (null === $comparison) {
  167. if (is_array($nama)) {
  168. $comparison = Criteria::IN;
  169. } elseif (preg_match('/[\%\*]/', $nama)) {
  170. $nama = str_replace('*', '%', $nama);
  171. $comparison = Criteria::LIKE;
  172. }
  173. }
  174. return $this->addUsingAlias(MataPelajaranPeer::NAMA, $nama, $comparison);
  175. }
  176. /**
  177. * Filter the query on the kompetensi_keahlian_id column
  178. *
  179. * @param int|array $kompetensiKeahlianId The value to use as filter.
  180. * Accepts an associative array('min' => $minValue, 'max' => $maxValue)
  181. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  182. *
  183. * @return MataPelajaranQuery The current query, for fluid interface
  184. */
  185. public function filterByKompetensiKeahlianId($kompetensiKeahlianId = null, $comparison = null)
  186. {
  187. if (is_array($kompetensiKeahlianId)) {
  188. $useMinMax = false;
  189. if (isset($kompetensiKeahlianId['min'])) {
  190. $this->addUsingAlias(MataPelajaranPeer::KOMPETENSI_KEAHLIAN_ID, $kompetensiKeahlianId['min'], Criteria::GREATER_EQUAL);
  191. $useMinMax = true;
  192. }
  193. if (isset($kompetensiKeahlianId['max'])) {
  194. $this->addUsingAlias(MataPelajaranPeer::KOMPETENSI_KEAHLIAN_ID, $kompetensiKeahlianId['max'], Criteria::LESS_EQUAL);
  195. $useMinMax = true;
  196. }
  197. if ($useMinMax) {
  198. return $this;
  199. }
  200. if (null === $comparison) {
  201. $comparison = Criteria::IN;
  202. }
  203. }
  204. return $this->addUsingAlias(MataPelajaranPeer::KOMPETENSI_KEAHLIAN_ID, $kompetensiKeahlianId, $comparison);
  205. }
  206. /**
  207. * Filter the query by a related KompetensiKeahlian object
  208. *
  209. * @param KompetensiKeahlian $kompetensiKeahlian the related object to use as filter
  210. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  211. *
  212. * @return MataPelajaranQuery The current query, for fluid interface
  213. */
  214. public function filterByKompetensiKeahlian($kompetensiKeahlian, $comparison = null)
  215. {
  216. return $this
  217. ->addUsingAlias(MataPelajaranPeer::KOMPETENSI_KEAHLIAN_ID, $kompetensiKeahlian->getKompetensiKeahlianId(), $comparison);
  218. }
  219. /**
  220. * Adds a JOIN clause to the query using the KompetensiKeahlian relation
  221. *
  222. * @param string $relationAlias optional alias for the relation
  223. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  224. *
  225. * @return MataPelajaranQuery The current query, for fluid interface
  226. */
  227. public function joinKompetensiKeahlian($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  228. {
  229. $tableMap = $this->getTableMap();
  230. $relationMap = $tableMap->getRelation('KompetensiKeahlian');
  231. // create a ModelJoin object for this join
  232. $join = new ModelJoin();
  233. $join->setJoinType($joinType);
  234. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  235. if ($previousJoin = $this->getPreviousJoin()) {
  236. $join->setPreviousJoin($previousJoin);
  237. }
  238. // add the ModelJoin to the current object
  239. if($relationAlias) {
  240. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  241. $this->addJoinObject($join, $relationAlias);
  242. } else {
  243. $this->addJoinObject($join, 'KompetensiKeahlian');
  244. }
  245. return $this;
  246. }
  247. /**
  248. * Use the KompetensiKeahlian relation KompetensiKeahlian object
  249. *
  250. * @see useQuery()
  251. *
  252. * @param string $relationAlias optional alias for the relation,
  253. * to be used as main alias in the secondary query
  254. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  255. *
  256. * @return KompetensiKeahlianQuery A secondary query class using the current class as primary query
  257. */
  258. public function useKompetensiKeahlianQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  259. {
  260. return $this
  261. ->joinKompetensiKeahlian($relationAlias, $joinType)
  262. ->useQuery($relationAlias ? $relationAlias : 'KompetensiKeahlian', 'KompetensiKeahlianQuery');
  263. }
  264. /**
  265. * Filter the query by a related Tugas object
  266. *
  267. * @param Tugas $tugas the related object to use as filter
  268. * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  269. *
  270. * @return MataPelajaranQuery The current query, for fluid interface
  271. */
  272. public function filterByTugas($tugas, $comparison = null)
  273. {
  274. return $this
  275. ->addUsingAlias(MataPelajaranPeer::MATA_PELAJARAN_ID, $tugas->getMataPelajaranId(), $comparison);
  276. }
  277. /**
  278. * Adds a JOIN clause to the query using the Tugas relation
  279. *
  280. * @param string $relationAlias optional alias for the relation
  281. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  282. *
  283. * @return MataPelajaranQuery The current query, for fluid interface
  284. */
  285. public function joinTugas($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  286. {
  287. $tableMap = $this->getTableMap();
  288. $relationMap = $tableMap->getRelation('Tugas');
  289. // create a ModelJoin object for this join
  290. $join = new ModelJoin();
  291. $join->setJoinType($joinType);
  292. $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
  293. if ($previousJoin = $this->getPreviousJoin()) {
  294. $join->setPreviousJoin($previousJoin);
  295. }
  296. // add the ModelJoin to the current object
  297. if($relationAlias) {
  298. $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
  299. $this->addJoinObject($join, $relationAlias);
  300. } else {
  301. $this->addJoinObject($join, 'Tugas');
  302. }
  303. return $this;
  304. }
  305. /**
  306. * Use the Tugas relation Tugas object
  307. *
  308. * @see useQuery()
  309. *
  310. * @param string $relationAlias optional alias for the relation,
  311. * to be used as main alias in the secondary query
  312. * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
  313. *
  314. * @return TugasQuery A secondary query class using the current class as primary query
  315. */
  316. public function useTugasQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
  317. {
  318. return $this
  319. ->joinTugas($relationAlias, $joinType)
  320. ->useQuery($relationAlias ? $relationAlias : 'Tugas', 'TugasQuery');
  321. }
  322. /**
  323. * Exclude object from result
  324. *
  325. * @param MataPelajaran $mataPelajaran Object to remove from the list of results
  326. *
  327. * @return MataPelajaranQuery The current query, for fluid interface
  328. */
  329. public function prune($mataPelajaran = null)
  330. {
  331. if ($mataPelajaran) {
  332. $this->addUsingAlias(MataPelajaranPeer::MATA_PELAJARAN_ID, $mataPelajaran->getMataPelajaranId(), Criteria::NOT_EQUAL);
  333. }
  334. return $this;
  335. }
  336. } // BaseMataPelajaranQuery