Just get where
Collapse
X
-
Yeah, I check the codes you sent. I tried to do this. But it gives me a mistake. I'm on the custom report page.Leave a comment:
-
Very big thanks
Argument 1 passed to Espo\\ORM\\DB\\Query\\Base::getWhere() must implement interface Espo\\ORM\\IEntity, string given, called
because I use stringWhat does this mean tanya ?Code:$this->getEntityManager()->getQuery()->getWhere('Meeting' ,$whereClause, 'AND', $params);Leave a comment:
-
$whereClause = $params['whereClause'];
if (empty($whereClause)) {
$whereClause = array();
}
if (!$deleted) {
$whereClause = $whereClause + array('deleted' => 0);
}
if (empty($params['joins'])) {
$params['joins'] = array();
}
if (empty($params['leftJoins'])) {
$params['leftJoins'] = array();
}
if (empty($params['customJoin'])) {
$params['customJoin'] = '';
}
$wherePart = $this->getEntityManager()->getQuery()->getWhere($entity, $whereClause, 'AND', $params);
$where = "WHERE " . $wherePart;
copied from the the shared file....Leave a comment:
-
If you spend 2 minutes for reading the code, you will see, how is built each part of select query, wherePart as well.
Leave a comment:
-
Yes, I see, I use it. But I do not want it to be "SELECT * FROM meeting". This function creates them. Because it wants an entity. I just need "WHERE".Leave a comment:
-
Just get where
I want to get only the WHERE part of the SQL output. Because I will add "where" as to pure php.
for example; WHERE assigned_status = 'Okay'
like this
Code:$sql = $this->getEntityManager()->getQuery()->createSelectQuery('Meeting', $selectParams); $sth = $pdo->prepare($sql); $sth->execute();Last edited by codeboy; 05-16-2018, 08:01 AM.Tags: None

Leave a comment: