public static function getById(Project_Build $build, User $user, $access = Access::READ, array $options = array()) { $ret = false; $access = (int) $access; // Unfortunately, no enums, no type hinting, no cry. $sql = 'SELECT pd.*' . ' FROM phpdepend' . $build->getProjectId() . ' pd, projectuser pu' . ' WHERE pu.projectid=?' . ' AND pu.userid=?' . ' AND pu.access & ?' . ' AND pd.buildid=?'; $val = array($build->getProjectId(), $user->getId(), $access, $build->getId()); if ($rs = Database::query($sql, $val)) { if ($rs->nextRow()) { $ret = self::_getObject($rs, $build); } } return $ret; }