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
2c22fe3f
Commit
2c22fe3f
authored
Nov 23, 2013
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code style and docs at "yii\sphinx\*" fixed.
parent
400b5310
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
10 deletions
+19
-10
ActiveQuery.php
extensions/sphinx/ActiveQuery.php
+16
-2
ActiveRecord.php
extensions/sphinx/ActiveRecord.php
+2
-2
Schema.php
extensions/sphinx/Schema.php
+1
-6
No files found.
extensions/sphinx/ActiveQuery.php
View file @
2c22fe3f
...
@@ -67,15 +67,29 @@ class ActiveQuery extends Query implements ActiveQueryInterface
...
@@ -67,15 +67,29 @@ class ActiveQuery extends Query implements ActiveQueryInterface
public
$sql
;
public
$sql
;
/**
/**
* Sets the [[snippetCallback]] to [[fetchSnippetSourceFromModels]], which allows to
* Sets the [[snippetCallback]] to [[fetchSnippetSourceFromModels
()
]], which allows to
* fetch the snippet source strings from the Active Record models, using method
* fetch the snippet source strings from the Active Record models, using method
* [[ActiveRecord::getSnippetSource()]].
* [[ActiveRecord::getSnippetSource()]].
* For example:
*
* ~~~
* class Article extends ActiveRecord
* {
* public function getSnippetSource()
* {
* return file_get_contents('/path/to/source/files/' . $this->id . '.txt');;
* }
* }
*
* $articles = Article::find()->snippetByModel()->all();
* ~~~
*
* Warning: this option should NOT be used with [[asArray]] at the same time!
* Warning: this option should NOT be used with [[asArray]] at the same time!
* @return static the query object itself
* @return static the query object itself
*/
*/
public
function
snippetByModel
()
public
function
snippetByModel
()
{
{
$this
->
snippetCallback
(
array
(
$this
,
'fetchSnippetSourceFromModels'
)
);
$this
->
snippetCallback
(
[
$this
,
'fetchSnippetSourceFromModels'
]
);
return
$this
;
return
$this
;
}
}
...
...
extensions/sphinx/ActiveRecord.php
View file @
2c22fe3f
...
@@ -361,9 +361,9 @@ abstract class ActiveRecord extends Model
...
@@ -361,9 +361,9 @@ abstract class ActiveRecord extends Model
* (because another user has modified the data), a [[StaleObjectException]] exception will be thrown,
* (because another user has modified the data), a [[StaleObjectException]] exception will be thrown,
* and the update or deletion is skipped.
* and the update or deletion is skipped.
*
*
* Optimi
zed
locking is only supported by [[update()]] and [[delete()]].
* Optimi
stic
locking is only supported by [[update()]] and [[delete()]].
*
*
* To use optimi
zed
locking:
* To use optimi
stic
locking:
*
*
* 1. Create a column to store the version number of each row. The column type should be `BIGINT DEFAULT 0`.
* 1. Create a column to store the version number of each row. The column type should be `BIGINT DEFAULT 0`.
* Override this method to return the name of this column.
* Override this method to return the name of this column.
...
...
extensions/sphinx/Schema.php
View file @
2c22fe3f
...
@@ -317,13 +317,8 @@ class Schema extends Object
...
@@ -317,13 +317,8 @@ class Schema extends Object
if
(
!
is_string
(
$str
))
{
if
(
!
is_string
(
$str
))
{
return
$str
;
return
$str
;
}
}
$this
->
db
->
open
();
$this
->
db
->
open
();
if
((
$value
=
$this
->
db
->
pdo
->
quote
(
$str
))
!==
false
)
{
return
$this
->
db
->
pdo
->
quote
(
$str
);
return
$value
;
}
else
{
// the driver doesn't support quote (e.g. oci)
return
"'"
.
addcslashes
(
str_replace
(
"'"
,
"''"
,
$str
),
"
\000\n\r\\\032
"
)
.
"'"
;
}
}
}
/**
/**
...
...
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