public function getAllChildren($parent_id = null)
    {
        $parent_id = $parent_id ?? $this->id;
        $children = $this::find()->where(['parent_id' => $parent_id])->all();
        return $children;
    }
public function getAllChildren($parent_id = null)
    {
        $parent_id = $parent_id ?? $this->id;
        $children = $this::find()->where(['parent_id' => $parent_id])->all();
        return $children;
    }
public function getAllChildren ( $ parent_id = null ) { $ parent_id = $ parent_id ?? $ this -> id ; $ children = $ this :: find ( ) -> where ( [ 'parent_id' => $ parent_id ] ) -> all ( ) ; return $ children ; }
Gets all children
@param $parent_id integer
@return \yii\db\ActiveQuery|array
Gets all children