Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
ff52f28d
Commit
ff52f28d
authored
Nov 30, 2013
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjusted elasticsearch and redis AR to use BaseAR
parent
c3eb4d92
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
71 deletions
+3
-71
ActiveRecord.php
extensions/elasticsearch/ActiveRecord.php
+3
-44
ActiveRecord.php
extensions/redis/ActiveRecord.php
+0
-27
No files found.
extensions/elasticsearch/ActiveRecord.php
View file @
ff52f28d
...
...
@@ -10,6 +10,8 @@ namespace yii\elasticsearch;
use
yii\base\InvalidCallException
;
use
yii\base\InvalidConfigException
;
use
yii\base\NotSupportedException
;
use
yii\db\ActiveRecordInterface
;
use
yii\db\BaseActiveRecord
;
use
yii\helpers\Inflector
;
use
yii\helpers\Json
;
use
yii\helpers\StringHelper
;
...
...
@@ -42,7 +44,7 @@ use yii\helpers\StringHelper;
* @author Carsten Brandt <mail@cebe.cc>
* @since 2.0
*/
class
ActiveRecord
extends
\yii\db\
ActiveRecord
class
ActiveRecord
extends
Base
ActiveRecord
{
const
PRIMARY_KEY_NAME
=
'id'
;
...
...
@@ -428,47 +430,4 @@ class ActiveRecord extends \yii\db\ActiveRecord
}
return
$n
;
}
/**
* @inheritdoc
*/
public
static
function
updateAllCounters
(
$counters
,
$condition
=
null
,
$params
=
[])
{
throw
new
NotSupportedException
(
'Update Counters is not supported by elasticsearch ActiveRecord.'
);
}
/**
* @inheritdoc
*/
public
static
function
getTableSchema
()
{
throw
new
NotSupportedException
(
'getTableSchema() is not supported by elasticsearch ActiveRecord.'
);
}
/**
* @inheritdoc
*/
public
static
function
tableName
()
{
return
static
::
index
()
.
'/'
.
static
::
type
();
}
/**
* @inheritdoc
*/
public
static
function
findBySql
(
$sql
,
$params
=
[])
{
throw
new
NotSupportedException
(
'findBySql() is not supported by elasticsearch ActiveRecord.'
);
}
/**
* Returns a value indicating whether the specified operation is transactional in the current [[scenario]].
* This method will always return false as transactional operations are not supported by elasticsearch.
* @param integer $operation the operation to check. Possible values are [[OP_INSERT]], [[OP_UPDATE]] and [[OP_DELETE]].
* @return boolean whether the specified operation is transactional in the current [[scenario]].
*/
public
function
isTransactional
(
$operation
)
{
return
false
;
}
}
extensions/redis/ActiveRecord.php
View file @
ff52f28d
...
...
@@ -292,31 +292,4 @@ class ActiveRecord extends \yii\db\ActiveRecord
}
return
md5
(
json_encode
(
$key
));
}
/**
* @inheritdoc
*/
public
static
function
getTableSchema
()
{
throw
new
NotSupportedException
(
'getTableSchema() is not supported by redis ActiveRecord.'
);
}
/**
* @inheritdoc
*/
public
static
function
findBySql
(
$sql
,
$params
=
[])
{
throw
new
NotSupportedException
(
'findBySql() is not supported by redis ActiveRecord.'
);
}
/**
* Returns a value indicating whether the specified operation is transactional in the current [[scenario]].
* This method will always return false as transactional operations are not supported by redis.
* @param integer $operation the operation to check. Possible values are [[OP_INSERT]], [[OP_UPDATE]] and [[OP_DELETE]].
* @return boolean whether the specified operation is transactional in the current [[scenario]].
*/
public
function
isTransactional
(
$operation
)
{
return
false
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment