<?php
namespace Main\CompositePattern;

require_once 'Object.php';
require_once 'AbstractWorker.php';

use \Main\Object;

class Worker extends  AbstractWorker
{
	// Attributes
	private $_name;
	private $_costPerHour;
	
	// Constructor
	
	public function __construct($name, $costPerHour)
	{
		$this->_name = $name;
		$this->_costPerHour = $costPerHour;
	}
	
	// Methods for properties
	// Getters and Setters
	public function GetName()
	{
		return $this->_name;
	}
	
	public function GetCost()
	{
		return $this->_costPerHour;
	}
	
	// Methods
	public function CalculateCost($hoursWorked)
	{
		return $hoursWorked * $this->_costPerHour;
	}
}
?>