<?php
App::uses('SeoGeneratorFactory', 'Seo.Model/MetaGenerators');
class MetaGeneratedBehavior extends ModelBehavior {


# ~ Parse metatags before save - - - - - - - - - - - - - - - - - - - - - - - - #
	public function afterSaveAll(Model $Model, $options = []) {
		$data = $Model->find('first', [
			'recursive' => 1,
			'conditions' => [
				$Model->alias . '.id' => $Model->id ]
		]);
		$Model->set($data);
		return (bool)SeoGeneratorFactory::afterSaveGeneration($Model);
	}
}
