<?php

/**
 * Class TB_Shared_Ent_TeamData_KKSpecialProfileAttributes
 *
 * @property int $id
 * @property int $appointment_id
 * @property int $team_id
 * @property int $profile_id
 * @property float $hourly_rate
 * @property float $gross_hour
 * @property float $pause_hour
 * @property float $net_hour
 * @property float $additional_pay
 * @property string|null $notice
 * @property DateTime $last_updated_dt
 * @property DateTime $created_dt
 */
class TB_Shared_Ent_TeamData_KKSpecialProfileWorkshift extends Francis_Db_Row
{

    public static function getByAppointmentIdAndTeamIdAndProfileId( $appointmentId, $teamId, $profileId )
    {
        $sql = 'SELECT * FROM ' . self::getTable() . ' WHERE ';
        $sql .= 'appointment_id = :appointment_id AND team_id = :team_id AND profile_id = :profile_id LIMIT 1 ';

        $params = array( ':appointment_id' => $appointmentId, ':team_id' => $teamId, ':profile_id' => $profileId );
        return self::findOne( $sql, $params );
    }

    /**
     * Return table name
     *
     * @return null|string
     */
    public static function getTable()
    {
        return 'kkspecial_profile_workshift';
    }

    /**
     * Return db handler
     *
     * @return Francis_Db_MySql|null
     */
    public static function getDbh()
    {
        return TB_Shared_Db_TeamData::get();
    }
}