linuxyii-relations

Yii relation returns null on Linux


I'm facing with a strange problem. I made an application on Windows, and I'm trying to deploy it to Linux. I know about the case problems, and corrected it where I could, but this time I don't know what to do.

I have the following model:

public function relations()
{
    $tmp=parent::relations();
    $tmp['applied_teams']=array(self::MANY_MANY, 'Group',     'qualification(group_id,competition_id)');
    $tmp['rounds'] = array(self::MANY_MANY,     'Competition','competitions_competitions(competition_parent,competition_child)');
    return $tmp;
}

where applied_teams returns null, but rounds not. The records are correctly in the database. Do you have any idea what would make difference in it between these two operating systems?

UPDATE

I've written a workaround, but haven't find the reason of the problem. The getter method has no problem on linux:

public function getAppliedTeams() {
        $qs = Qualification::model()->findAll('competition_id=:c', array(':c' => $this->competition_id));
        if ($qs == null) {
            return null;
        }
        $results = array();
        foreach ($qs as $q) {
            $results[] = $q->group;
        }
        return $results;
    }

Solution

  • The problem was the MySQL engine. Server's default was MyISAM, not InnoDB, but foreign key creation did not threw exception ..