From a0987db2bb6f1e79274e4b18f106405651ce4a64 Mon Sep 17 00:00:00 2001 From: Biser Antonov Date: Mon, 5 Dec 2016 15:33:03 +0200 Subject: [PATCH] Added setters and getters to FactoryGenerator for accessing methods and properties lists --- src/Generators/FactoryGenerator.php | 60 +++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/src/Generators/FactoryGenerator.php b/src/Generators/FactoryGenerator.php index ea431b8..e393396 100644 --- a/src/Generators/FactoryGenerator.php +++ b/src/Generators/FactoryGenerator.php @@ -39,6 +39,66 @@ class FactoryGenerator extends EntityGenerator */ private static $properties = ['id', '_id', 'Id']; + /** + * Set methods for accessing model id. + * + * @param array $methods + */ + public static function setMethods(array $methods) + { + self::$methods = $methods; + } + + /** + * Get methods for accessing model id. + * + * @return string[] + */ + public static function getMethods() + { + return self::$methods; + } + + /** + * Add method for accessing model id. + * + * @param $method + */ + public static function addMethod($method) + { + self::$methods[] = $method; + } + + /** + * Set properties for accessing model id. + * + * @param array $properties + */ + public static function setProperties(array $properties) + { + self::$properties = $properties; + } + + /** + * Get properties for accessing model id. + * + * @return string[] + */ + public static function getProperties() + { + return self::$properties; + } + + /** + * Add property for accessing model id. + * + * @param $property + */ + public static function addProperty($property) + { + self::$properties[] = $property; + } + /** * Generate, and return the attribute. *