Пример #1
0
<?php

require_once 'class/HelperOfBailiff.php';
require_once 'class/Lock.php';
require_once 'class/LockMaster.php';
require_once 'class/Owner.php';
$owner = new Owner();
$owner->setIsPresent(true);
$owner->setAgrees(false);
$lock = new Lock();
$lock->setIsLocked(true);
$helperOfBailiff = new HelperOfBailiff();
$helperOfBailiff->order($owner, $lock);
echo ' 100: Kas uks on lukus?' . $lock->getIsLocked();
Пример #2
0
<?php

require 'error.php';
require_once 'Abi.php';
require_once 'Lock.php';
require_once 'LockMaster.php';
require_once 'Owner.php';
$owner = new Owner();
//kontroll
if (isset($_GET['valjatostmine'])) {
    $buildResult = true;
    if (isset($_GET['isOwnerPresent'])) {
        $duEvict = false;
        $owner->setIsPresent(true);
        if (isset($_GET['isOwnerAgree'])) {
            $owner->setAgrees(true);
        } else {
            $owner->setAgrees(false);
        }
    } else {
        $duEvict = true;
        $owner->setIsPresent(false);
        if (isset($_GET['isOwnerReachable'])) {
            $owner->setIsReachable(true);
            if (isset($_GET['isOwnerAgree'])) {
                $owner->setAgrees(true);
            } else {
                $owner->setAgrees(false);
            }
        } else {
            $owner->setIsReachable(false);