yii\elasticsearch\ActiveRecord::instantiate PHP Méthode

instantiate() public static méthode

This method is called together with ActiveRecord::populateRecord by ActiveQuery. It is not meant to be used for creating new records directly. You may override this method if the instance being created depends on the row data to be populated into the record. For example, by creating a record based on the value of a column, you may implement the so-called single-table inheritance mapping.
public static instantiate ( array $row ) : static
$row array row data to be populated into the record. This array consists of the following keys: - `_source`: refers to the attributes of the record. - `_type`: the type this record is stored in. - `_index`: the index this record is stored in.
Résultat static the newly created active record
    public static function instantiate($row)
    {
        return new static();
    }