本文整理匯總了PHP中type::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::where方法的具體用法?PHP type::where怎麽用?PHP type::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::where方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: update
/**
*
* @param PMSEObservable $subject
* @return type
*/
public function update($subject)
{
if (method_exists($subject, 'getProcessDefinition')) {
$this->logger->debug("Trigger update of a Related Relationship for a Process Definitions update");
$processDefinition = $subject->getProcessDefinition();
$processDefinitionData = $processDefinition->fetched_row;
$fields = array('id', 'rel_element_type');
$relatedDependency = $this->getRelatedDependencyBean();
$this->sugarQuery->select($fields);
$this->sugarQuery->from($relatedDependency);
$this->sugarQuery->where()->queryAnd()->addRaw("pro_id='{$processDefinitionData['id']}' AND prj_id='{$processDefinitionData['prj_id']}' AND deleted=0");
$result = $this->sugarQuery->compileSql();
$this->logger->debug("Retrieve dependencies query: {$result}");
$rows = $this->sugarQuery->execute();
foreach ($rows as $row) {
$bean = $this->getRelatedDependencyBean($row['id']);
$bean->pro_status = $processDefinitionData['pro_status'];
$bean->pro_locked_variables = $processDefinitionData['pro_locked_variables'];
$bean->pro_terminate_variables = $processDefinitionData['pro_terminate_variables'];
if ($bean->pro_module !== $processDefinitionData['pro_module'] && $row['rel_element_type'] == 'TERMINATE') {
$bean->deleted = true;
}
$bean->save();
}
$this->processRelatedDependencies($processDefinitionData);
$depNumber = count($rows);
$this->logger->debug("Updating {$depNumber} dependencies");
}
return $result;
}
示例2: findByPrimaryKey
/**
*
* @access public
* @since unknown
* @param type $value
* @return type
*/
public function findByPrimaryKey($value)
{
$this->daoMetadata->select($this->getFields());
$this->daoMetadata->from($this->getTableName());
$this->daoMetadata->where('s_site', $value);
$result = $this->daoMetadata->get();
if ($result == false) {
return array();
}
return $result->row();
}
示例3: validateReclaimCase
/**
* Method to validate whether a case been claimed
* @param $casID
* @param $casIndex
* @return object
*/
public function validateReclaimCase($casID, $casIndex)
{
//TODO Review functionality
$res = array();
//new stdClass();
$res['success'] = true;
$res['result'] = false;
//$caseBean = new BpmInbox();
$caseBean = $this->getInboxBean();
$this->sugarQueryObject->select(array('a.cas_id'));
$this->sugarQueryObject->from($caseBean, array('alias' => 'a'));
$this->sugarQueryObject->joinRaw("LEFT JOIN pmse_bpm_flow b ON (a.cas_id = b.cas_id)", array('alias' => 'b'));
$this->sugarQueryObject->where()->queryAnd()->addRaw("b.cas_id = {$casID} and a.cas_index = {$casIndex}");
$rows = $this->sugarQueryObject->execute();
$caseData = $rows[0];
$res['message'] = translate('LBL_PMSE_LABEL_ERROR_INVALIDCLAIM', 'pmse_Project');
if ($caseData['cas_start_date'] == '') {
$res['result'] = true;
}
return $res;
}
示例4: scopeValid
/**
* Pre-defined query scopes
*
* @param type $query
*/
public function scopeValid($query)
{
$query->where('start_at', '<=', Carbon::now())->where('end_at', '>=', Carbon::now());
}
示例5: setBooleanSearchQuery
/**
* Process BOOLEAN type of search
* @param type $query
* @param type $key
* @param array $values
*/
protected function setBooleanSearchQuery($query, $key, array $values)
{
$opertor = $values['operator'];
if (isset(static::$searchParams[$key]['relation'])) {
$relationKey = static::$searchParams[$key]['relation'][1];
$query->whereHas(static::$searchParams[$key]['relation'][0], function ($q) use($relationKey, $opertor) {
$q->where($relationKey, $opertor == '!!1');
});
} else {
$query->where($key, $opertor == '!!1');
}
}
示例6: scopeIsPrimary
/**
* Return primary Files
* @param type $query
* @return query
*/
public function scopeIsPrimary($query)
{
return $query->where('is_primary', '=', 1);
}