Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 2338 | Rev 2340 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2338 Rev 2339
Línea 80... Línea 80...
80
        ->unnest()
80
        ->unnest()
81
        ->unnest();    
81
        ->unnest();    
Línea 82... Línea 82...
82
        
82
        
83
        return $this->executeFetchOneObject($select, $prototype);
83
        return $this->executeFetchOneObject($select, $prototype);
84
    }
84
    }
-
 
85
 
-
 
86
    public function fetchOneByCompanyId1AndUserId2($company_id, $user_id)
-
 
87
    {
-
 
88
        $prototype = new Conversation();
-
 
89
        $select = $this->sql->select(self::_TABLE);
-
 
90
        $select->where->and->nest()
-
 
91
        ->nest()
-
 
92
        ->equalTo('sender_company_id', $company_id)
-
 
93
        ->and->equalTo('receiver_id', $user_id)
-
 
94
        ->unnest()
-
 
95
        ->or->nest()
-
 
96
        ->equalTo('receiver_company_id', $company_id)
-
 
97
        ->and->equalTo('sender_id', $user_id)
-
 
98
        ->unnest()
-
 
99
        ->unnest();    
-
 
100
        
-
 
101
        return $this->executeFetchOneObject($select, $prototype);
-
 
102
    }
-
 
103
 
85
    
104
 
86
    /**
105
    /**
87
     *
106
     *
88
     * @param int $user_id
107
     * @param int $user_id
89
     * @return Conversation[]
108
     * @return Conversation[]
Línea 104... Línea 123...
104
        ->unnest()
123
        ->unnest()
105
        ->unnest();
124
        ->unnest();
Línea 106... Línea 125...
106
        
125
        
107
        return $this->executeFetchAllObject($select, $prototype);
126
        return $this->executeFetchAllObject($select, $prototype);
108
    }
127
    }
109
    
128
 
110
    public function fetchAllByCompanyId($company_id)
129
    public function fetchAllByCompanyId($company_id)
111
    {
130
    {
Línea 112... Línea 131...
112
        $prototype = new Conversation();
131
        $prototype = new Conversation();