# vikbooking/1.8.15/admin/helpers/src/cron/factory.php

VikBooking Hotel Booking Engine &amp; PMS, version 1.8.15. 61 lines.

- Page: https://pluginprobe.com/plugins/vikbooking/1.8.15/code/admin/helpers/src/cron/factory.php
- Raw: https://pluginprobe.com/plugins/vikbooking/1.8.15/raw/admin/helpers/src/cron/factory.php
- Modified: 2026-09-14T11:37:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/vikbooking/1.8.15/code/admin/helpers/src/cron/factory.php#L10-L20`.

```php
<?php
/** 
 * @package     VikBooking
 * @subpackage  core
 * @author      E4J s.r.l.
 * @copyright   Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @link        https://vikwp.com
 */

// No direct access
defined('ABSPATH') or die('No script kiddies please!');

/**
 * VikBooking cron job factory.
 *
 * @since 1.5.10
 */
class VBOCronFactory
{
	use VBOFactoryAware;

	/**
	 * Class contructor.
	 */
	public function __construct()
	{
		$this->instanceClassPrefix = 'VikBookingCronJob';
	}

	/**
	 * Children classes can override this method to rearrange the ordering
	 * of the elements created through this factory class.
	 * 
	 * @param   array  &$list  The list of instances.
	 * 
	 * @return  void
	 */
	protected function rearrangeInstances(&$list)
	{
		// sort cron jobs by title
		uasort($list, function($a, $b)
		{
			return strcasecmp($a->getTitle(), $b->getTitle());
		});
	}

	/**
	 * Children classes can override this method to make sure that the
	 * created instance is compliant with the factory requirements.
	 * 
	 * @param   mixed    $object  The object to validate.
	 * 
	 * @return  boolean  True if valid, false otherwise.
	 */
	protected function isInstanceValid($object)
	{
		return $object instanceof VBOCronJob;
	}
}

```
