Skip to content

Commit

Permalink
Added setters and getters to FactoryGenerator for accessing methods and
Browse files Browse the repository at this point in the history
properties lists
  • Loading branch information
biserantonov authored and ddinchev committed Jul 3, 2021
1 parent e6a525f commit a0987db
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions src/Generators/FactoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit a0987db

Please sign in to comment.