Back in Chapter 3,Adding the Business Logic and Complex Application Logic, we had to display the locations for each vacancy. This was very simple to achieve by using the proxy methods. Using the generator.yml
configuration file, working with foreign keys is just as easy. Moving on to the vacancies module, we create it in the exact same way. But this time we give the module a new name, and not the name suggested by the model name.
>symfony propel:generate-admin --module="vacancies" backend Vacancy
As you can see, there is an optional parameter—module=""
that will allow us to name our module on our own. Before we continue to view our vacancies module, we must add a __toString()
method to the StoreLocation
model in lib/model/StoreLocation.php:
class StoreLocation extends BaseStoreLocation
{
public function __toString()
{
return $this->getCity(). ' (' . $this->getCountry() .')';
}
}
Add the following code to data/fixtures/fixtures.yml:
StoreLocation...