private function _addRelations(array $params, $primaryKeyName) { foreach (self::$relationNames as $relationName) { if (isset($params[$relationName])) { foreach ($params[$relationName] as $relation => $relationParams) { $this->_addRelation(RelationFactory::create($relationName, $relation, $relationParams, $primaryKeyName)); } } } }