Announcement

Collapse
No announcement yet.

I'm not access the team_user table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • I'm not access the team_user table

    I create custom reports and filter for teams. There are two new fields in the "team_user" table. Start and end dates. These two new areas need to be conditioned for where. But I can not find entitiy for "team_user".

    I can break the "$where" variable for the activity table but I can't do this for the "team_user" table.

    For example;

    Code:
    $params = array();
    $result['whereClause'][] = $this->convertDateTimeWhere(array(
        'type' => $type,
        'value' => $value,
        'attribute' => 'dateStart',
        'timeZone' => $timeZone
    ));
    
    if (empty($result)) {
        $result = array();
    }
    
    $entity    = $this->getEntityManager()->getEntity('Meeting');
    $wherePart = $this->getEntityManager()->getQuery()->getWhere($entity ,$result['whereClause'], 'AND', $params);
    
    return $wherePart;
    $entity = $this->getEntityManager()->getEntity('TeamUser'); not working. I need this.

    I added the sample image file.
    Attached Files

  • #3
    How to use tanya?

    $entity = $this->getEntityManager()->getRepository('Team')->findRelated($teamId,'teamuser');

    Don't work

    Comment


    • #4
      the last parameter is the name of the link
      this name https://github.com/espocrm/espocrm/b.../Team.json#L27
      And this method returns not one entity, but the list of entities

      Comment


      • #5
        Originally posted by tanya View Post
        the last parameter is the name of the link
        this name https://github.com/espocrm/espocrm/b.../Team.json#L27
        And this method returns not one entity, but the list of entities
        Hello again,
        I do not want to relationship the user. I have new features in the team_user table. (Start and end date). I need to specify "where" in these two columns.

        For example;

        Code:
        $userIdList = [];
        $targetTeamId = '5adc54b31d11c1a1a';        
        $team = $this->getEntityManager()->getEntity('Team', $targetTeamId);
        
        $targetUserList = $this->getEntityManager()->getRepository('Team')->findRelated($team, 'users', array(
            'whereClause' => $this->convertDateTimeWhere(array(
                'type' => $type,
                'value' => $value,
                'attribute' => 'startDate',
                'timeZone' => $timeZone
            ))
        ));
        
        foreach ($targetUserList as $user) {
            $userIdList[] = $user->id;
        }
        
        return $userIdList;
        Only "users" in this way works. I want to access the team_user table startDate attibutes for where. Do you understand me ? I want access "team_user" table.
        Please help me.

        Comment


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

          Comment

          Working...
          X