More Related Content Similar to My Development Story (20) My Development Story7. /
github
CakePHP Amazon A2S( ECS4.0)
Amazon-eCommerce-datasource
github ”cake amazon”
9. XML
CD/ / (Author/Artist),(Title),
(Releasedate/Publicationdate)
/ /
11. extends
libs
AppController
shell controller
$jenreID/$subJenreID
12. Sample Extends
1 <?php
2 App::import('Controller', 'libs/author_checks');
3
4 class CdArtistChecksController extends AuthorChecksController {
5 var $name = 'CdArtistChecks';
6 var $jenreID = 'Cd';
7 var $subJenreID = 'Artist';
8}
9 ?>
13. Sample Extends
<?php
2 class AuthorChecksController extends AppController {
3 var $helpers = array('Html', 'Form');
4 var $paginate = array(
5 'AuthorCheck' => array(
6 'limit' => 10,
7 'conditions' => array('deleted' => 0),
8 'order' => array('created' => 'asc'),
9 'contain' => false,
10 'with' => 'suggests'));
11
12 function __construct() {
13 $this->jenreID = Inflector::Camelize($this->jenreID);
14 $this->subJenreID = Inflector::Camelize($this->subJenreID);
15 $this->prefix = $this->jenreID.$this->subJenreID;
16. GUI (Controller )
CUI (Shell )
25. Sample ClassRegistory
1 <?php
2 class AuthorModel extends AppModel {
3 function __construct($id = false, $table = NULL, $ds = NULL){
4 $this->jenreID = Inflector::Camelize($this->jenreID);
5 $this->subJenreID = Inflector::Camelize($this->subJenreID);
6 $this->prefix = $this->jenreID.$this->subJenreID;
7 App::Import('Model',
array($this->prefix.'NRWord',
$this->prefix.'SWord',
$this->prefix.'Check'));
8 $this->{$this->prefix.'NRWord'} =
ClassRegistry::init($this->prefix.'NRWord');
constructor
ClassRegistory
PHP
35. Sample TestCase
6 class CdItemTestCase extends CakeTestCase {
7 var $CdItem = null;
8 var $fixtures = array(
23 );
24
25 function startTest() {
26 $this->CdItem =& ClassRegistry::init('CdItem');
27 $this->CdItem->AmazonAdvertising->
useDbConfig = 'amazon_ecommerce';
28 }
36. App::import
Behavior ...
ClassRegistory::init constructor