foreach ( $system as $sysFile ) { $this->EfsFile->contain(); $found = $this->EfsFile->find('first', array( 'conditions' => array( 'EfsFile.filename'=> $sysFile['filename'], 'EfsFile.project_id'=> $current_project_id ) )); if ( $found ) { // OK, this file exists already } }