<?php
declare(strict_types=1);

namespace App\Model\Table;

use Cake\ORM\Table;

class TeachersTable extends Table
{
    public function initialize(array $config): void
    {
        parent::initialize($config);

        $this->setTable('teachers');
        $this->setDisplayField('full_name');
        $this->setPrimaryKey('id');
        $this->addBehavior('Timestamp');

        $this->hasMany('AvailabilitySlots', [
            'foreignKey' => 'teacher_id',
        ]);
        $this->hasMany('Bookings', [
            'foreignKey' => 'teacher_id',
        ]);
    }
}
