1

Is there any way to create data objects for MySQL database tables using Zend_Tool?

What I am trying to achieve is to create setter/getter methods and column variable of any table in some class by using command line zf utility. (like we can do it in pear)

Gordon
  • 312,688
  • 75
  • 539
  • 559
Pawan
  • 517
  • 1
  • 9
  • 25
  • 1
    Have you read the manual about the model and database generation with ZF_TOOL? If not, see if is it what you are looking for ... http://framework.zend.com/manual/en/learning.quickstart.create-model.html – Ademir Mazer Jr - Nuno Mar 04 '12 at 22:33

1 Answers1

1

You would need to create your own providers for Zend_Tool.

Essentially, you create a class that extends Zend_Tool_Project_Provider_Abstract. Every public method becomes an action available within the zf.sh tool.

You also need to register your new provider with Zend_Tool. Do this by running:

  1. run zf --setup storage-directory
  2. run zf --setup config-file
  3. edit ~/.zf.ini and add php.include_path and basicloader.classes.0 entries that point to your new provider's path and classname respectively.

Further details: http://akrabat.com/zend-framework/akrabat_db_schema_manager-zend-framework-database-migrations/ & https://github.com/akrabat/Akrabat/blob/master/zf1/Akrabat/Tool/DatabaseSchemaProvider.php

Rob Allen
  • 12,643
  • 1
  • 40
  • 49