<?php

namespace Hecate\Customizer\Repositories;


abstract class BaseRepository {


	static  $defaultClass     = null;
	static  $registerFunction = '';

	public static function getCustomClasssByType() {
		return array();
	}

	public static function getMergedClassesByType() {
		return array_merge(
			array( 'default' => static::$defaultClass ),
			static::getCustomClasssByType()
		);
	}

	public static function registerTypes( $wp_customize ) {
		$elements = static::getMergedClassesByType();

		foreach ( $elements as $key => $element ) {
			if ( $key === 'default' ) {
				continue;
			}
			call_user_func( array( $wp_customize, static::$registerFunction ), $element );
		}

	}
}
