File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed
Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1212 }
1313 ],
1414 "require" : {
15- "cakephp/cakephp" : " ~3.0 " ,
15+ "cakephp/cakephp" : " ^3.5 " ,
1616 "php" : " >=5.6"
1717 },
1818 "require-dev" : {
Original file line number Diff line number Diff line change @@ -29,21 +29,21 @@ class SearchableBehavior extends Behavior
2929 */
3030 public function initialize (array $ config )
3131 {
32- $ connection = $ this ->_table ->connection ();
32+ $ connection = $ this ->_table ->getConnection ();
3333
3434 //ensure database engine is MySQL
35- if (!$ connection ->driver () instanceof Mysql) {
35+ if (!$ connection ->getDriver () instanceof Mysql) {
3636 throw new SearchableFatalException ('Only MySQL is supported ' );
3737 }
3838
3939 //build a whitelist of string/text columns
40- $ collection = $ connection ->schemaCollection ();
41- $ columns = $ collection ->describe ($ this ->_table ->table ())->columns ();
40+ $ collection = $ connection ->getSchemaCollection ();
41+ $ columns = $ collection ->describe ($ this ->_table ->getTable ())->columns ();
4242 foreach ($ columns as $ column ) {
43- $ columnInfo = $ collection ->describe ($ this ->_table ->table ())->column ($ column );
43+ $ columnInfo = $ collection ->describe ($ this ->_table ->getTable ())->getColumn ($ column );
4444 if (($ columnInfo ['type ' ] == 'string ' ) || ($ columnInfo ['type ' ] == 'text ' )) {
4545 $ this ->_columnsWhitelist [] = $ column ;
46- $ this ->_columnsWhitelist [] = $ this ->_table ->alias () . '. ' . $ column ;
46+ $ this ->_columnsWhitelist [] = $ this ->_table ->getAlias () . '. ' . $ column ;
4747 }
4848 }
4949 }
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ public function testInvalidDB()
106106 $ this ->setExpectedException ('Chris48s\Searchable\Exception\SearchableFatalException ' );
107107
108108 //set up a SQLite DB connection - SQLite is not supported
109- ConnectionManager::config ('invalid ' , [
109+ ConnectionManager::setConfig ('invalid ' , [
110110 'url ' => 'sqlite:///:memory: ' ,
111111 'timezone ' => 'UTC '
112112 ]);
Original file line number Diff line number Diff line change 6666 ]
6767];
6868
69- Cake \Cache \Cache::config ($ cache );
69+ Cake \Cache \Cache::setConfig ($ cache );
7070Cake \Core \Configure::write ('Session ' , [
7171 'defaults ' => 'php '
7272]);
7878 putenv ('db_dsn=sqlite:///:memory: ' );
7979}
8080
81- Cake \Datasource \ConnectionManager::config ('test ' , [
81+ Cake \Datasource \ConnectionManager::setConfig ('test ' , [
8282 'url ' => getenv ('db_dsn ' ),
8383 'timezone ' => 'UTC '
8484]);
You can’t perform that action at this time.
0 commit comments