Jump to content
php.lv forumi

<?php searchProgrammer(); ?>


Ir ko piedavat

Recommended Posts

<?php
define ('KOLEKTIVS', 'SIA Ustum');
define ('VIETA', 'Rigas centrs');

class Programmer extends Employee {
public function isValid () {
	require 'Javascript.js';
	require 'Database.sql';
}
public function apply () {
	$to = 'gribustradat@ustum.lv';
	$subject = 'Programmetaja vakance';
	mail($to, $subject, $this->programmer_description);
}
}

if(is_readable($this)){
$Person = new Programmer;
$Person->apply();
if($Person->isValid()){
	JobInterview();
}
}else{
ReadManual();
}
?>

Link to comment
Share on other sites

  • Replies 61
  • Created
  • Last Reply

Top Posters In This Topic

Nuja :)

 

1) metodes, kas saakas ar is(isValid, isEnabled, etc) parasti atgriez boolean. Include tur galiigi neiederas.

2) esmu pieradis pie Java naming convention. Tas nozīmē, ka metodes/variabljus atdala ar lielajiem burtiem, nevis underscore (isValid(), nevis is_readable(), $programmer->programmerDescription, nevis $programmer->programmer_description. Citādi dažādās vietās tiek izmantoti dažādi 'naming convention'.

3) Un $programmer->programmer_description vajadzētu būt $programmer->description, jo skaidrs, ka description attiecas uz programmeri, nevis uz sazin ko veel.

4) metode JobInterview() mosh vajag rakstīt ar mazo burtu (ti, jobInterview()). Klasēm lai paliek lielais sākuma burts

5) jobInterview() vajadzeetu padot arii $programmer objektu

Link to comment
Share on other sites

black, kā šitais vairants :)

define ('KOLEKTIVS', 'SIA Ustum');
define ('VIETA', 'Rigas centrs');

class Programmer extends Employee {
 public function isValid () {
return @include('Javascript.js') && @include('Database.sql');
 }
 public function apply () {
$to = 'gribustradat@ustum.lv';
$subject = 'Programmetaja vakance';
mail($to, $subject, $this->description);
 }
}

$me = new Programmer();
if(isAvailable($me) && $me -> isValid()) {
 $me->apply();
 Ustum::jobInterview($me);
}

 

edit: burtiņi

edit2: isValid()

edit3: isValid() otro reiz

Edited by v3rb0
Link to comment
Share on other sites


×
×
  • Create New...