Just get where

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • codeboy
    replied
    Thanks, I solved tanya.
    Last edited by codeboy; 05-16-2018, 11:09 AM.

    Leave a comment:


  • codeboy
    replied
    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:


  • tanya
    replied
    means, the method waits for an object (of Meeting Entity)

    Leave a comment:


  • codeboy
    replied
    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 string
    Code:
    $this->getEntityManager()->getQuery()->getWhere('Meeting' ,$whereClause, 'AND', $params);
    What does this mean tanya ?

    Leave a comment:


  • tanya
    replied
    $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:


  • codeboy
    replied
    I could not. Would you show me a little sample, please?

    Leave a comment:


  • tanya
    replied
    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:


  • codeboy
    replied
    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:


  • tanya
    replied

    EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.

    Leave a comment:


  • codeboy
    started a topic Just get where

    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.
Working...