public function getStatementForDate($date)
    {
        if (is_string($date)) {
            $date = new \DateTime($date);
        }

        foreach ($this->statements as $stmt) {
            if ($stmt->getDate() == $date) {
                return $stmt;
            }
        }

        return null;
    }
public function getStatementForDate($date)
    {
        if (is_string($date)) {
            $date = new \DateTime($date);
        }

        foreach ($this->statements as $stmt) {
            if ($stmt->getDate() == $date) {
                return $stmt;
            }
        }

        return null;
    }
public function getStatementForDate ( $ date ) { if ( is_string ( $ date ) ) { $ date = new \ DateTime ( $ date ) ; } foreach ( $ this -> statements as $ stmt ) { if ( $ stmt -> getDate ( ) == $ date ) { return $ stmt ; } } return null ; }
Gets statement for given date.

@param string|\DateTime $date
@return Statement|null
Gets statement for given date .