Yii Framework Forum: yii stop autoload subobjects - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

yii stop autoload subobjects Yii autoloading subobjects with relations Rate Topic: -----

#1 User is offline   Zdunek 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 10-July 17

Posted 10 July 2017 - 05:09 AM

Yii autoloading subobjects with relations. I like to block autoload subobjects on object. Performance issue on multiple objects.

 public function relations() {
    // NOTE: you may need to adjust the relation name and the related
    // class name for the relations automatically generated below.
    return array(
        'testReportConfig' => array(self::HAS_ONE, 'TestReportConfig', 'id_test'),
        'candColSettings' => array(self::HAS_MANY, 'CandColSettings', 'id_test_fk'),
        'storProducts' => array(self::HAS_MANY, 'StorProducts', 'id_test'),
        'storePointGeneralPrices' => array(self::HAS_MANY, 'StorePointGeneralPrice', 'id_test_fk'),
        'testAnswers' => array(self::HAS_MANY, 'TestAnswer', 'id_test'),
        'testTestsGroups' => array(self::HAS_ONE, 'TestTestsGroups', 'id_test'),
        'recrApplications' => array(self::MANY_MANY, 'RecrApplication', 'test_assessets(id_test, id_application_pk)'),
        'testManagements' => array(self::HAS_MANY, 'TestManagement', 'id_test'),
        'testManagementTests' => array(self::HAS_MANY, 'TestManagementTests', 'id_test'),
        'testQuestions' => array(self::HAS_MANY, 'TestQuestions', 'id_test'),
        'testReportConfig' => array(self::HAS_ONE, 'TestReportConfig', 'id_test'),
        'testReportCompetences' => array(self::HAS_MANY, 'TestReportCompetences', 'id_test'),
        'idOwner' => array(self::BELONGS_TO, 'CoreUsers', 'id_owner'),
        'idType' => array(self::BELONGS_TO, 'TestTestsType', 'id_type'),
        'idPosition' => array(self::BELONGS_TO, 'ToolPosition', 'id_position'),
        'toolCompetenciesTrees' => array(self::MANY_MANY, 'ToolCompetenciesTree', 'test_tests_competencies(id_test, id_competence)'),
        'toolCompetencyModels' => array(self::MANY_MANY, 'ToolCompetencyModel', 'tool_competency_model_tools(id_test, id_competency_model)'),
        'toolSimpleModels' => array(self::HAS_MANY, 'ToolSimpleModel', 'id_test'),
        'testStandards' => array(self::HAS_MANY, 'TestStandards', 'id_test'),
        'vDetailedIndicators' => array(self::HAS_MANY, 'VDetailedIndicators', 'id_test'),
        'vGeneralIndicators' => array(self::HAS_MANY, 'VGeneralIndicators', 'id_test'),
    );
}


I need stop autoload not when declaring relations, but when i create a parent object. How to do it?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users