public function getSiblings($role, $primaryOnly = false)
    {
        $primaryField = $this->getPrimaryField($role);
        $parentObject = $this->owner->parentObject;
        $childObject = $this->owner->childObject;
        if (empty($childObject)) {
            return [];
        }
        $relationFields = [];
        if ($primaryOnly) {
            $relationFields['{{%alias%}}.[[' . $primaryField . ']]'] = 1;
        }

        return $childObject->siblingRelationQuery($parentObject, ['where' => $relationFields], ['disableAccess' => true])->all();
    }
public function getSiblings($role, $primaryOnly = false)
    {
        $primaryField = $this->getPrimaryField($role);
        $parentObject = $this->owner->parentObject;
        $childObject = $this->owner->childObject;
        if (empty($childObject)) {
            return [];
        }
        $relationFields = [];
        if ($primaryOnly) {
            $relationFields['{{%alias%}}.[[' . $primaryField . ']]'] = 1;
        }

        return $childObject->siblingRelationQuery($parentObject, ['where' => $relationFields], ['disableAccess' => true])->all();
    }
public function getSiblings ( $ role , $ primaryOnly = false ) { $ primaryField = $ this -> getPrimaryField ( $ role ) ; $ parentObject = $ this -> owner -> parentObject ; $ childObject = $ this -> owner -> childObject ; if ( empty ( $ childObject ) ) { return [ ] ; } $ relationFields = [ ] ; if ( $ primaryOnly ) { $ relationFields [ '{{%alias%}}.[[' . $ primaryField . ']]' ] = 1 ; } return $ childObject -> siblingRelationQuery ( $ parentObject , [ 'where' => $ relationFields ] , [ 'disableAccess' => true ] ) -> all ( ) ; }
Get siblings.

@param [[@doctodo param_type:role]] $role        [[@doctodo param_description:role]]
@param boolean                      $primaryOnly [[@doctodo param_description:primaryOnly]] [optional]

@return [[@doctodo return_type:getSiblings]] [[@doctodo return_description:getSiblings]]
Get siblings .