fewbricks\bricks\brick::create_sub_brick_object PHP Method

create_sub_brick_object() protected method

protected create_sub_brick_object ( $sub_brick_name, $name_setting ) : mixed
$sub_brick_name
$name_setting
return mixed
    protected function create_sub_brick_object($sub_brick_name, $name_setting)
    {
        $sub_brick_name = '\\fewbricks\\bricks\\' . $sub_brick_name;
        $object = new $sub_brick_name($this->get_name() . '_' . $name_setting);
        /** @noinspection PhpUndefinedMethodInspection */
        $object->set_is_layout($this->is_layout);
        /** @noinspection PhpUndefinedMethodInspection */
        $object->set_is_sub_field($this->is_sub_field);
        /** @noinspection PhpUndefinedMethodInspection */
        $object->set_is_option($this->is_option);
        return $object;
    }