ICal\ICal::__construct PHP Method

__construct() public method

Creates the iCal Object
public __construct ( mixed $filename = false, mixed $weekStart = false ) : void
$filename mixed The path to the iCal-file or an array of lines from an iCal file
$weekStart mixed The default first day of the week (SU or MO, etc.)
return void or false if no filename is provided
    public function __construct($filename = false, $weekStart = false)
    {
        if (!$filename) {
            return false;
        }
        if (is_array($filename)) {
            $lines = $filename;
        } else {
            $lines = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
        }
        if ($weekStart) {
            $this->defaultWeekStart = $weekStart;
        }
        $this->initLines($lines);
    }