# SWDB

# \K_Unit_Transformation

Unit transformation.

Represents an object from the table 'k_unit_transformation'.

## Summary

Methods
Properties
Constants
__construct()
get_image()
$db
$id
$family
$unit
$skill
No constants found
No protected methods found
No protected properties found
N/A
load_skills()
No private properties found
N/A

File
  application/entity/K_Unit_Transformation.php
Package
  Default
Class hierarchy
  \Entity
  \K_Unit_Transformation

## Tags

category | Entity

## Properties

### $db

    $db : resource

#### Type

resource — Database connection.

#

Inherited from
  \Entity

## Tags

None found

### $id

    $id : integer

#### Type

integer — Transformed unit identifier.

#

## Tags

None found

### $family

    $family : integer

#### Type

integer — Transformed unit family id.

#

## Tags

None found

### $unit

    $unit : integer

#### Type

integer — ID of the unit that transformes into this.

#

## Tags

None found

### $skill

    $skill : array<mixed,\K_Monster_Skill>

#### Type

array<mixed,\K_Monster_Skill> — Skills in the transformed form.

#

## Tags

None found

## Methods

### __construct()

    __construct(resource  $db, integer  $id)

Constructor.

Searches the database and retrieves the information about the trnsformed unit, populating it and it's items.

#### Parameters

resource | $db | Connection to the database.
integer | $id | TRansformed unit identifier.

#

## Tags

None found

### get_image()

    get_image() : string

Gets the path to the unit image. The image must be in the img/unit/ directory, and it's name must be the unit id, padded with '0' to 8 digits, and the extension must be '.png'.

#### Returns

string —

Image URL, or a fixed unknown image.

#

## Tags

None found

### load_skills()

    load_skills()

Loads the information about the unit skills in the transformed form.

#

## Tags

None found

### K_Unit_Transformation.php