<?php

namespace Hecate\Components;

abstract class ComponentPartsBase {

	abstract public function elements();

	public function getElementById( $id ) {
		$result   = null;
		$elements = $this->elements();
		foreach ( $elements as $element ) {
			if ( $element['id'] === $id ) {
				$result = $element;
			}
		}
		return $result;
	}
}
