So I have read too many of this questions already, and have also read PHP: Passing by reference manual and still cannot figure out why I am seeing this.
So I have a PHP Class
class ProfileTranslator extends EntityTranslator {
public function getProfile($identifier) {
try {
$stmt = $this->dbConn->prepare("CALL get_profile(?)");
$stmt->bindParam(1, $identifier, \PDO::PARAM_STR);
$stmt->execute();
$rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);
unset($stmt);
$count = count($rows);
if ($count == 1) {
$row = $rows[0];
$profile = new entity\Profile();
$this->assignProfileData($row, $profile);
// more stuff below...
}
private function assignProfileData($row, $profile) {
$profile->setProfileId($row['profileid']);
// do some more ->setXYZ's()
$this->getAccount($profile); // GETTING ERROR HERE (THIS IS LINE 119)
}
private function getAccount($profile) {
// get the account stuff here
}
}
Error:
( ! ) Strict standards: Only variables should be passed by reference in ProfileTranslator.php on line 119
What is the problem with this code? Isn't $profile
a variable?