public function isApplicable(File $file)
    {
        if (empty($this->databoxes) && empty($this->collections)) {
            return true;
        }

        if (null === $file->getCollection()) {
            return true;
        }

        $fileDatabox = $file->getCollection()->get_databox();

        foreach ($this->databoxes as $databox) {
            if ($databox->get_sbas_id() ===
                $fileDatabox->get_sbas_id()) {
                return true;
            }
        }

        foreach ($this->collections as $collection) {
            if ($collection->get_base_id() === $file->getCollection()->get_base_id()) {
                return true;
            }
        }

        return false;
    }
public function isApplicable(File $file)
    {
        if (empty($this->databoxes) && empty($this->collections)) {
            return true;
        }

        if (null === $file->getCollection()) {
            return true;
        }

        $fileDatabox = $file->getCollection()->get_databox();

        foreach ($this->databoxes as $databox) {
            if ($databox->get_sbas_id() ===
                $fileDatabox->get_sbas_id()) {
                return true;
            }
        }

        foreach ($this->collections as $collection) {
            if ($collection->get_base_id() === $file->getCollection()->get_base_id()) {
                return true;
            }
        }

        return false;
    }
public function isApplicable ( File $ file ) { if ( empty ( $ this -> databoxes ) && empty ( $ this -> collections ) ) { return true ; } if ( null === $ file -> getCollection ( ) ) { return true ; } $ fileDatabox = $ file -> getCollection ( ) -> get_databox ( ) ; foreach ( $ this -> databoxes as $ databox ) { if ( $ databox -> get_sbas_id ( ) === $ fileDatabox -> get_sbas_id ( ) ) { return true ; } } foreach ( $ this -> collections as $ collection ) { if ( $ collection -> get_base_id ( ) === $ file -> getCollection ( ) -> get_base_id ( ) ) { return true ; } } return false ; }
Returns true if the checker should be executed against the current file

@param File $file A file to check

@return Boolean
Returns true if the checker should be executed against the current file