Ok, the problem is that I am using a class, which depends on external configuration to work and validate things but, since these properties are so many in quantity, I would like to know, how to import them.
So, imagine this is the class:
class doSomething{
public function __construct($conn){
$this->conn = $conn;
}
public function validateURL($url){
//do something with $url
}
public function validateName($name){
//do something with $name
}
public function validateAge($age){
// process age
}
public function lookEmailInDatabase($email, $table){
// process data
}
}
Now, lets assume the above is inside a files called doSomthingClass.php
So, lets asume, that I have another class to declare values for those properties
function declareProperties($val){
$conn = new PDO(...);
$url = 'http://foo.com';
$name = 'john';
$age = '17';
$email = 'simon@yahoo.com';
$table = 'foobartar';
return $val;
}
Now, the question is, what would be very efficient, best way to export those properties into this class, as I am not even sure, if the settings should be written inside a function, or another class ..