<?php

namespace SugarCalendarBookings\Support\Activities;

use SugarCalendarBookings\Support\Database\AbstractModel;

/**
 * Activity model.
 *
 * @since 1.0.0
 *
 * @property int    $id
 * @property string $object_type
 * @property int    $object_id
 * @property string $type
 * @property int    $user_id
 * @property string $content
 * @property string $created_at
 */
class ActivityModel extends AbstractModel {

	/**
	 * The database table name without prefix.
	 *
	 * @since 1.0.0
	 *
	 * @var string
	 */
	protected static $table_name = 'activities';

	/**
	 * The model type identifier.
	 *
	 * @since 1.0.0
	 *
	 * @var string
	 */
	protected static $type = 'activity';

	/**
	 * Column formats for the model.
	 *
	 * @since 1.0.0
	 *
	 * @var array<string, string>
	 */
	protected static $column_formats = [
		'id'          => '%d',
		'object_type' => '%s',
		'object_id'   => '%d',
		'type'        => '%s',
		'user_id'     => '%d',
		'content'     => '%s',
		'created_at'  => '%s',
	];

	/**
	 * The attributes and meta that should be cast.
	 *
	 * @since 1.0.0
	 *
	 * @var array<string, string>
	 */
	protected static $casts = [
		'id'         => 'integer',
		'object_id'  => 'integer',
		'user_id'    => 'integer',
		'created_at' => 'datetime',
	];

	/**
	 * Column defaults for the model.
	 *
	 * @since 1.0.0
	 *
	 * @return array<string, mixed>
	 */
	protected static function column_defaults() {

		return [
			'user_id' => 0,
		];
	}
}
