mergeWith($criteria);
}
return $query;
}
/**
* Find object by primary key.
* Propel uses the instance pool to skip the database if the object exists.
* Go fast if the query is untouched.
*
*
* $obj = $c->findPk(12, $con);
*
*
* @param mixed $key Primary key to use for the query
* @param PropelPDO $con an optional connection object
*
* @return AlarmBalanceMonitor|AlarmBalanceMonitor[]|mixed the result, formatted by the current formatter
*/
public function findPk($key, $con = null)
{
if ($key === null) {
return null;
}
if ((null !== ($obj = AlarmBalanceMonitorPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
// the object is already in the instance pool
return $obj;
}
if ($con === null) {
$con = Propel::getConnection(AlarmBalanceMonitorPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$this->basePreSelect($con);
if ($this->formatter || $this->modelAlias || $this->with || $this->select
|| $this->selectColumns || $this->asColumns || $this->selectModifiers
|| $this->map || $this->having || $this->joins) {
return $this->findPkComplex($key, $con);
} else {
return $this->findPkSimple($key, $con);
}
}
/**
* Alias of findPk to use instance pooling
*
* @param mixed $key Primary key to use for the query
* @param PropelPDO $con A connection object
*
* @return AlarmBalanceMonitor A model object, or null if the key is not found
* @throws PropelException
*/
public function findOneById($key, $con = null)
{
return $this->findPk($key, $con);
}
/**
* Find object by primary key using raw SQL to go fast.
* Bypass doSelect() and the object formatter by using generated code.
*
* @param mixed $key Primary key to use for the query
* @param PropelPDO $con A connection object
*
* @return AlarmBalanceMonitor A model object, or null if the key is not found
* @throws PropelException
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT `id`, `mod`, `name`, `uncfd_asta_bal`, `cfd_asta_bal`, `evt_sel_mode`, `bal_evt_sel`, `esc_host_sel` FROM `alm_bal_mon` WHERE `id` = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
}
$obj = null;
if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
$obj = new AlarmBalanceMonitor();
$obj->hydrate($row);
AlarmBalanceMonitorPeer::addInstanceToPool($obj, (string) $key);
}
$stmt->closeCursor();
return $obj;
}
/**
* Find object by primary key.
*
* @param mixed $key Primary key to use for the query
* @param PropelPDO $con A connection object
*
* @return AlarmBalanceMonitor|AlarmBalanceMonitor[]|mixed the result, formatted by the current formatter
*/
protected function findPkComplex($key, $con)
{
// As the query uses a PK condition, no limit(1) is necessary.
$criteria = $this->isKeepQuery() ? clone $this : $this;
$stmt = $criteria
->filterByPrimaryKey($key)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
}
/**
* Find objects by primary key
*
* $objs = $c->findPks(array(12, 56, 832), $con);
*
* @param array $keys Primary keys to use for the query
* @param PropelPDO $con an optional connection object
*
* @return PropelObjectCollection|AlarmBalanceMonitor[]|mixed the list of results, formatted by the current formatter
*/
public function findPks($keys, $con = null)
{
if ($con === null) {
$con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
}
$this->basePreSelect($con);
$criteria = $this->isKeepQuery() ? clone $this : $this;
$stmt = $criteria
->filterByPrimaryKeys($keys)
->doSelect($con);
return $criteria->getFormatter()->init($criteria)->format($stmt);
}
/**
* Filter the query by primary key
*
* @param mixed $key Primary key to use for the query
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function filterByPrimaryKey($key)
{
return $this->addUsingAlias(AlarmBalanceMonitorPeer::ID, $key, Criteria::EQUAL);
}
/**
* Filter the query by a list of primary keys
*
* @param array $keys The list of primary key to use for the query
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function filterByPrimaryKeys($keys)
{
return $this->addUsingAlias(AlarmBalanceMonitorPeer::ID, $keys, Criteria::IN);
}
/**
* Filter the query on the id column
*
* Example usage:
*
* $query->filterById(1234); // WHERE id = 1234
* $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterById(array('min' => 12)); // WHERE id >= 12
* $query->filterById(array('max' => 12)); // WHERE id <= 12
*
*
* @param mixed $id The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function filterById($id = null, $comparison = null)
{
if (is_array($id)) {
$useMinMax = false;
if (isset($id['min'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::ID, $id['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($id['max'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::ID, $id['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AlarmBalanceMonitorPeer::ID, $id, $comparison);
}
/**
* Filter the query on the mod column
*
* Example usage:
*
* $query->filterByMod(1234); // WHERE mod = 1234
* $query->filterByMod(array(12, 34)); // WHERE mod IN (12, 34)
* $query->filterByMod(array('min' => 12)); // WHERE mod >= 12
* $query->filterByMod(array('max' => 12)); // WHERE mod <= 12
*
*
* @param mixed $mod The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function filterByMod($mod = null, $comparison = null)
{
if (is_array($mod)) {
$useMinMax = false;
if (isset($mod['min'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::MOD, $mod['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($mod['max'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::MOD, $mod['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AlarmBalanceMonitorPeer::MOD, $mod, $comparison);
}
/**
* Filter the query on the name column
*
* Example usage:
*
* $query->filterByName('fooValue'); // WHERE name = 'fooValue'
* $query->filterByName('%fooValue%'); // WHERE name LIKE '%fooValue%'
*
*
* @param string $name The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function filterByName($name = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($name)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $name)) {
$name = str_replace('*', '%', $name);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(AlarmBalanceMonitorPeer::NAME, $name, $comparison);
}
/**
* Filter the query on the uncfd_asta_bal column
*
* Example usage:
*
* $query->filterByUncfdAstaBal(1234); // WHERE uncfd_asta_bal = 1234
* $query->filterByUncfdAstaBal(array(12, 34)); // WHERE uncfd_asta_bal IN (12, 34)
* $query->filterByUncfdAstaBal(array('min' => 12)); // WHERE uncfd_asta_bal >= 12
* $query->filterByUncfdAstaBal(array('max' => 12)); // WHERE uncfd_asta_bal <= 12
*
*
* @param mixed $uncfdAstaBal The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function filterByUncfdAstaBal($uncfdAstaBal = null, $comparison = null)
{
if (is_array($uncfdAstaBal)) {
$useMinMax = false;
if (isset($uncfdAstaBal['min'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::UNCFD_ASTA_BAL, $uncfdAstaBal['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($uncfdAstaBal['max'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::UNCFD_ASTA_BAL, $uncfdAstaBal['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AlarmBalanceMonitorPeer::UNCFD_ASTA_BAL, $uncfdAstaBal, $comparison);
}
/**
* Filter the query on the cfd_asta_bal column
*
* Example usage:
*
* $query->filterByCfdAstaBal(1234); // WHERE cfd_asta_bal = 1234
* $query->filterByCfdAstaBal(array(12, 34)); // WHERE cfd_asta_bal IN (12, 34)
* $query->filterByCfdAstaBal(array('min' => 12)); // WHERE cfd_asta_bal >= 12
* $query->filterByCfdAstaBal(array('max' => 12)); // WHERE cfd_asta_bal <= 12
*
*
* @param mixed $cfdAstaBal The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function filterByCfdAstaBal($cfdAstaBal = null, $comparison = null)
{
if (is_array($cfdAstaBal)) {
$useMinMax = false;
if (isset($cfdAstaBal['min'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::CFD_ASTA_BAL, $cfdAstaBal['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($cfdAstaBal['max'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::CFD_ASTA_BAL, $cfdAstaBal['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AlarmBalanceMonitorPeer::CFD_ASTA_BAL, $cfdAstaBal, $comparison);
}
/**
* Filter the query on the evt_sel_mode column
*
* Example usage:
*
* $query->filterByEvtSelMode(1234); // WHERE evt_sel_mode = 1234
* $query->filterByEvtSelMode(array(12, 34)); // WHERE evt_sel_mode IN (12, 34)
* $query->filterByEvtSelMode(array('min' => 12)); // WHERE evt_sel_mode >= 12
* $query->filterByEvtSelMode(array('max' => 12)); // WHERE evt_sel_mode <= 12
*
*
* @param mixed $evtSelMode The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function filterByEvtSelMode($evtSelMode = null, $comparison = null)
{
if (is_array($evtSelMode)) {
$useMinMax = false;
if (isset($evtSelMode['min'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::EVT_SEL_MODE, $evtSelMode['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($evtSelMode['max'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::EVT_SEL_MODE, $evtSelMode['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AlarmBalanceMonitorPeer::EVT_SEL_MODE, $evtSelMode, $comparison);
}
/**
* Filter the query on the bal_evt_sel column
*
* Example usage:
*
* $query->filterByBalEvtSel(1234); // WHERE bal_evt_sel = 1234
* $query->filterByBalEvtSel(array(12, 34)); // WHERE bal_evt_sel IN (12, 34)
* $query->filterByBalEvtSel(array('min' => 12)); // WHERE bal_evt_sel >= 12
* $query->filterByBalEvtSel(array('max' => 12)); // WHERE bal_evt_sel <= 12
*
*
* @param mixed $balEvtSel The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function filterByBalEvtSel($balEvtSel = null, $comparison = null)
{
if (is_array($balEvtSel)) {
$useMinMax = false;
if (isset($balEvtSel['min'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::BAL_EVT_SEL, $balEvtSel['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($balEvtSel['max'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::BAL_EVT_SEL, $balEvtSel['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AlarmBalanceMonitorPeer::BAL_EVT_SEL, $balEvtSel, $comparison);
}
/**
* Filter the query on the esc_host_sel column
*
* Example usage:
*
* $query->filterByEscHostSel(1234); // WHERE esc_host_sel = 1234
* $query->filterByEscHostSel(array(12, 34)); // WHERE esc_host_sel IN (12, 34)
* $query->filterByEscHostSel(array('min' => 12)); // WHERE esc_host_sel >= 12
* $query->filterByEscHostSel(array('max' => 12)); // WHERE esc_host_sel <= 12
*
*
* @param mixed $escHostSel The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function filterByEscHostSel($escHostSel = null, $comparison = null)
{
if (is_array($escHostSel)) {
$useMinMax = false;
if (isset($escHostSel['min'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::ESC_HOST_SEL, $escHostSel['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($escHostSel['max'])) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::ESC_HOST_SEL, $escHostSel['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(AlarmBalanceMonitorPeer::ESC_HOST_SEL, $escHostSel, $comparison);
}
/**
* Filter the query by a related BalancingEventSelector object
*
* @param BalancingEventSelector|PropelObjectCollection $balancingEventSelector the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByBes($balancingEventSelector, $comparison = null)
{
if ($balancingEventSelector instanceof BalancingEventSelector) {
return $this
->addUsingAlias(AlarmBalanceMonitorPeer::ID, $balancingEventSelector->getAbmId(), $comparison);
} elseif ($balancingEventSelector instanceof PropelObjectCollection) {
return $this
->useBesQuery()
->filterByPrimaryKeys($balancingEventSelector->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByBes() only accepts arguments of type BalancingEventSelector or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the Bes relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function joinBes($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Bes');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Bes');
}
return $this;
}
/**
* Use the Bes relation BalancingEventSelector object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return BalancingEventSelectorQuery A secondary query class using the current class as primary query
*/
public function useBesQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinBes($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Bes', 'BalancingEventSelectorQuery');
}
/**
* Filter the query by a related EscalationHostSelector object
*
* @param EscalationHostSelector|PropelObjectCollection $escalationHostSelector the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByEhs($escalationHostSelector, $comparison = null)
{
if ($escalationHostSelector instanceof EscalationHostSelector) {
return $this
->addUsingAlias(AlarmBalanceMonitorPeer::ID, $escalationHostSelector->getAbmId(), $comparison);
} elseif ($escalationHostSelector instanceof PropelObjectCollection) {
return $this
->useEhsQuery()
->filterByPrimaryKeys($escalationHostSelector->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByEhs() only accepts arguments of type EscalationHostSelector or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the Ehs relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function joinEhs($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Ehs');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Ehs');
}
return $this;
}
/**
* Use the Ehs relation EscalationHostSelector object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return EscalationHostSelectorQuery A secondary query class using the current class as primary query
*/
public function useEhsQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinEhs($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Ehs', 'EscalationHostSelectorQuery');
}
/**
* Exclude object from result
*
* @param AlarmBalanceMonitor $alarmBalanceMonitor Object to remove from the list of results
*
* @return AlarmBalanceMonitorQuery The current query, for fluid interface
*/
public function prune($alarmBalanceMonitor = null)
{
if ($alarmBalanceMonitor) {
$this->addUsingAlias(AlarmBalanceMonitorPeer::ID, $alarmBalanceMonitor->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
}