Elgg\Database\SubtypeTable::update PHP Method

update() public method

Update a registered \ElggEntity type, subtype, and class name
public update ( string $type, string $subtype, string $class = '' ) : boolean
$type string Type
$subtype string Subtype
$class string Class name to use when loading this entity
return boolean
    public function update($type, $subtype, $class = '')
    {
        $id = $this->getId($type, $subtype);
        if (!$id) {
            return false;
        }
        $sql = "\n\t\t\tUPDATE {$this->db->prefix}entity_subtypes\n\t\t\tSET type = :type, subtype = :subtype, class = :class\n\t\t\tWHERE id = :id\n\t\t";
        $params = [':type' => $type, ':subtype' => $subtype, ':class' => $class, ':id' => $id];
        if (!$this->db->updateData($sql, false, $params)) {
            return false;
        }
        $this->invalidateCache();
        return true;
    }