ACMS_Filter
in package
ACMS_Filter
SQLヘルパの各種処理をラップしたメソッド群です メソッドの外で,条件対象のテーブルが選択されている必要があります 例外で,_field, _keywordはメソッド内でテーブルを自動で選択します
Table of Contents
Methods
- blogDisclosureSecretStatus() : void
- ブログの公開状態とアクセス中の権限に応じて,表示条件を振り分けます secretモードを表示対象にします
- blogField() : void
- ブログをfieldテーブルから,指定されたフィールドで検索します
- blogKeyword() : void
- ブログをfulltextテーブルから,指定されたキーワードで全文検索します
- blogOrder() : void
- ブログの特定フィールドを指定して,昇順または降順で並び替えます
- blogStatus() : void
- ブログの公開状態とアクセス中の権限に応じて,表示条件を振り分けます
- blogTree() : void
- ブログの階層構造を,axisを指定して絞り込みます
- categoryDisclosureSecretStatus() : void
- カテゴリーの公開状態とアクセス中の権限に応じて,表示条件を振り分けます secretモードを表示対象にします
- categoryField() : void
- カテゴリーをfieldテーブルから,指定されたフィールドで検索します
- categoryKeyword() : void
- カテゴリーをfulltextテーブルから,指定されたキーワードで全文検索します
- categoryOrder() : void
- カテゴリーの特定フィールドを指定して,昇順または降順で並び替えます
- categoryStatus() : void
- カテゴリーの公開状態とアクセス中の権限に応じて,表示条件を振り分けます
- categoryTree() : bool
- カテゴリーの階層構造を,axisを指定して絞り込みます
- categoryTreeGlobal() : void
- カテゴリーの階層構造で,指定されたbid以下すべてを対象とします
- columnByField() : void
- entryField() : array<string|int, mixed>
- エントリーをfieldテーブルから,指定されたフィールドで検索します
- entryKeyword() : void
- エントリーfulltextテーブルから,指定されたキーワードで全文検索します
- entryOrder() : string
- エントリーの特定フィールドを指定して,昇順または降順で並び替えます
- entrySession() : void
- 現在の日時が,公開期間に含まれていて,アクセス中の権限で表示可能なエントリーを絞り込みます
- entrySpan() : void
- 開始〜終了の指定による期間の該当する日付のエントリーを絞り込みます
- entryStatus() : void
- エントリーの公開状態とアクセス中の権限に応じて,表示条件を振り分けます
- entryTag() : void
- エントリーをタグで絞り込みます
- entryValidSpan() : void
- 指定された日時が,公開期間に含まれているエントリーを絞り込みます
- fieldList() : void
- fieldテーブルを,指定されたフィールドで検索します
- mediaKeyword() : void
- メディアテーブルから,指定されたキーワードで全文検索します
- mediaOrder() : void
- メディアの特定フィールドを指定して,昇順または降順で並び替えます
- mediaTagOrder() : void
- タグの特定フィールドを指定して,昇順または降順で並び替えます
- moduleKeyword() : void
- モジュールテーブルから,指定されたキーワードで全文検索します
- tagOrder() : void
- タグの特定フィールドを指定して,昇順または降順で並び替えます
- userField() : void
- ユーザーをfieldテーブルから,指定されたフィールドで検索します
- userKeyword() : void
- ユーザーをfulltextテーブルから,指定されたキーワードで全文検索します
- userOrder() : void
- ユーザーの特定フィールドを指定して,昇順または降順で並び替えます
- userStatus() : void
- ユーザーの公開状態とアクセス中の権限に応じて,表示条件を振り分けます
- _field() : array<string|int, string>
- field による絞り込みを行います
- _field_where() : void
- 指定したフィールド名のWhere句を組み立てます。 フィールドの結合子にemが含まれている場合は,falseを返します。
- _keyword() : void
- _keyword
- splitKeyword() : array<string|int, string>
- キーワードの分割する
Methods
blogDisclosureSecretStatus()
ブログの公開状態とアクセス中の権限に応じて,表示条件を振り分けます secretモードを表示対象にします
public
static blogDisclosureSecretStatus(T &$SQL[, string|null $scope = null ]) : void
ACMS_Filter::blogDisclosureSecretStatus($SQL);
Parameters
- $SQL : T
- $scope : string|null = null
Tags
blogField()
ブログをfieldテーブルから,指定されたフィールドで検索します
public
static blogField(T &$SQL, Field_Search $Field) : void
ACMS_Filter::blogField($SQL, $Field);
Parameters
- $SQL : T
- $Field : Field_Search
Tags
blogKeyword()
ブログをfulltextテーブルから,指定されたキーワードで全文検索します
public
static blogKeyword(T &$SQL, string $keyword) : void
ACMS_Filter::blogKeyword($SQL, 'first second third keywords')
Parameters
- $SQL : T
- $keyword : string
Tags
blogOrder()
ブログの特定フィールドを指定して,昇順または降順で並び替えます
public
static blogOrder(SQL_Select &$SQL, string $order[, string|null $scp = null ]) : void
[example] id-desc : ID降順 code-asc : コード昇順
ACMS_Filter::blogOrder($SQL, 'id-desc');
Parameters
- $SQL : SQL_Select
- $order : string
-
asc|desc
- $scp : string|null = null
Tags
blogStatus()
ブログの公開状態とアクセス中の権限に応じて,表示条件を振り分けます
public
static blogStatus(T &$SQL[, string|null $scope = null ]) : void
ACMS_Filter::blogStatus($SQL);
Parameters
- $SQL : T
- $scope : string|null = null
Tags
blogTree()
ブログの階層構造を,axisを指定して絞り込みます
public
static blogTree(T &$SQL, int $bid[, string $axis = 'self' ][, string|null $scope = null ]) : void
[example] self : 指定されたbidのブログ descendant : 指定されたbidの子孫ブログ ancestor : 指定されたbidの先祖ブログ
ACMS_Filter::blogTree($SQL, $bid, 'self-or-descendant');
Parameters
- $SQL : T
- $bid : int
- $axis : string = 'self'
-
self|descendant|ancestor
- $scope : string|null = null
Tags
categoryDisclosureSecretStatus()
カテゴリーの公開状態とアクセス中の権限に応じて,表示条件を振り分けます secretモードを表示対象にします
public
static categoryDisclosureSecretStatus(T &$SQL[, string|null $scope = null ]) : void
ACMS_Filter::categoryDisclosureSecretStatus($SQL);
Parameters
- $SQL : T
- $scope : string|null = null
Tags
categoryField()
カテゴリーをfieldテーブルから,指定されたフィールドで検索します
public
static categoryField(T &$SQL, Field_Search $Field) : void
ACMS_Filter::categoryField($SQL, $Field);
Parameters
- $SQL : T
- $Field : Field_Search
Tags
categoryKeyword()
カテゴリーをfulltextテーブルから,指定されたキーワードで全文検索します
public
static categoryKeyword(T &$SQL, string $keyword) : void
ACMS_Filter::categoryKeyword($SQL, 'first second third keywords')
Parameters
- $SQL : T
- $keyword : string
Tags
categoryOrder()
カテゴリーの特定フィールドを指定して,昇順または降順で並び替えます
public
static categoryOrder(SQL_Select &$SQL, string $order[, string|null $scope = null ]) : void
[example] id-desc : ID降順 code-asc : コード昇順
ACMS_Filter::categoryOrder($SQL, 'code-desc');
Parameters
- $SQL : SQL_Select
- $order : string
-
asc|desc
- $scope : string|null = null
Tags
categoryStatus()
カテゴリーの公開状態とアクセス中の権限に応じて,表示条件を振り分けます
public
static categoryStatus(T &$SQL[, string|null $scope = null ]) : void
ACMS_Filter::categoryStatus($SQL);
Parameters
- $SQL : T
- $scope : string|null = null
Tags
categoryTree()
カテゴリーの階層構造を,axisを指定して絞り込みます
public
static categoryTree(T &$SQL, int $cid[, string $axis = 'self' ][, string|null $scope = null ]) : bool
[example] self : 指定されたbidのカテゴリー descendant : 指定されたbidの子孫カテゴリー ancestor : 指定されたbidの先祖カテゴリー
ACMS_Filter::categoryTree($SQL, $cid, 'descendant');
Parameters
- $SQL : T
- $cid : int
- $axis : string = 'self'
- $scope : string|null = null
Tags
Return values
boolcategoryTreeGlobal()
カテゴリーの階層構造で,指定されたbid以下すべてを対象とします
public
static categoryTreeGlobal(T &$SQL, int $bid[, bool $self = true ][, string|null $categoryScope = null ][, string|null $blogScope = null ]) : void
ACMS_Filter::categoryTreeGlobal($SQL, $bid);
Parameters
- $SQL : T
- $bid : int
- $self : bool = true
- $categoryScope : string|null = null
- $blogScope : string|null = null
Tags
columnByField()
public
static columnByField(T &$sql, Field_Search $fieldSearch[, string $prefix = '' ][, string|null $scope = null ]) : void
Parameters
- $sql : T
- $fieldSearch : Field_Search
- $prefix : string = ''
-
カラム名のプレフィックス
- $scope : string|null = null
Tags
entryField()
エントリーをfieldテーブルから,指定されたフィールドで検索します
public
static entryField(T &$SQL, Field_Search $Field[, string|null $bScp = null ]) : array<string|int, mixed>
ACMS_Filter::entryField($SQL, $Field);
Parameters
- $SQL : T
- $Field : Field_Search
- $bScp : string|null = null
-
結合先のエイリアス名
Tags
Return values
array<string|int, mixed>entryKeyword()
エントリーfulltextテーブルから,指定されたキーワードで全文検索します
public
static entryKeyword(T &$SQL, string $keyword) : void
ACMS_Filter::entryKeyword($SQL, 'first second third keywords');
Parameters
- $SQL : T
- $keyword : string
Tags
entryOrder()
エントリーの特定フィールドを指定して,昇順または降順で並び替えます
public
static entryOrder(SQL_Select &$SQL, string|array<string|int, string> $order[, int|null $uid = null ][, int|null $cid = null ][, false|int $secondary_filed_sort = false ][, false|string $field_name = false ]) : string
[example] id-desc : ID降順 code-asc : コード昇順
ACMS_Filter::entryOrder($SQL, 'code-asc');
Parameters
- $SQL : SQL_Select
- $order : string|array<string|int, string>
-
表示順
- $uid : int|null = null
-
ユーザーID
- $cid : int|null = null
-
カテゴリーID
- $secondary_filed_sort : false|int = false
-
2以上の場合,第2表示順以降もフィールドでのソートを行います
- $field_name : false|string = false
-
ソートするフィールド名
Tags
Return values
stringentrySession()
現在の日時が,公開期間に含まれていて,アクセス中の権限で表示可能なエントリーを絞り込みます
public
static entrySession(T &$SQL[, string|null $scp = null ][, bool $private = false ]) : void
ACMS_Filter::entrySession($SQL);
Parameters
- $SQL : T
- $scp : string|null = null
- $private : bool = false
-
非公開エントリーを表示するか(true: 表示しない, false: 表示する)
Tags
entrySpan()
開始〜終了の指定による期間の該当する日付のエントリーを絞り込みます
public
static entrySpan(T &$SQL, string $start, string $end[, string|null $scope = null ]) : void
ACMS_Filter::entrySpan($SQL, '2010-01-01', '2010-12-31');
Parameters
- $SQL : T
- $start : string
-
'1001-01-01 00:00:00'
- $end : string
-
'9999-12-31 23:59:59'
- $scope : string|null = null
Tags
entryStatus()
エントリーの公開状態とアクセス中の権限に応じて,表示条件を振り分けます
public
static entryStatus(T &$SQL[, string|null $scope = null ]) : void
ACMS_Filter::entryStatus($SQL);
Parameters
- $SQL : T
- $scope : string|null = null
Tags
entryTag()
エントリーをタグで絞り込みます
public
static entryTag(T &$SQL, array<string|int, string> $tags[, string|null $scope = null ]) : void
ACMS_Filter::entryTag($SQL, $tags);
Parameters
- $SQL : T
- $tags : array<string|int, string>
- $scope : string|null = null
Tags
entryValidSpan()
指定された日時が,公開期間に含まれているエントリーを絞り込みます
public
static entryValidSpan(T &$SQL, string $datetime[, string|null $scope = null ]) : void
ACMS_Filter::entryValidSpan($SQL, '2011-04-21 13:00:00');
Parameters
- $SQL : T
- $datetime : string
-
'1001-01-01 00:00:00'
- $scope : string|null = null
Tags
fieldList()
fieldテーブルを,指定されたフィールドで検索します
public
static fieldList(T &$SQL, Field_Search $Field) : void
ACMS_Filter::fieldList($SQL, $Field);
Parameters
- $SQL : T
- $Field : Field_Search
Tags
mediaKeyword()
メディアテーブルから,指定されたキーワードで全文検索します
public
static mediaKeyword(T &$sql, string $keyword[, string|null $scope = null ][, array<string|int, string> $columns = [] ]) : void
ACMS_Filter::mediaKeyword($SQL, 'first second third keywords');
Parameters
- $sql : T
- $keyword : string
- $scope : string|null = null
- $columns : array<string|int, string> = []
Tags
mediaOrder()
メディアの特定フィールドを指定して,昇順または降順で並び替えます
public
static mediaOrder(SQL_Select &$SQL, string $order[, null $scope = null ]) : void
[example] name-desc : 名前降順
ACMS_Filter::mediaOrder($SQL, 'name-desc');
Parameters
- $SQL : SQL_Select
- $order : string
-
asc|desc
- $scope : null = null
Tags
mediaTagOrder()
タグの特定フィールドを指定して,昇順または降順で並び替えます
public
static mediaTagOrder(SQL_Select &$SQL, string $order[, null $scope = null ]) : void
[example] name-desc : 名前降順
ACMS_Filter::tagOrder($SQL, 'name-desc');
Parameters
- $SQL : SQL_Select
- $order : string
-
asc|desc
- $scope : null = null
Tags
moduleKeyword()
モジュールテーブルから,指定されたキーワードで全文検索します
public
static moduleKeyword(T &$sql, string $keyword[, string|null $scope = null ][, array<string|int, string> $columns = [] ]) : void
ACMS_Filter::moduleKeyword($SQL, 'first second third keywords');
Parameters
- $sql : T
- $keyword : string
- $scope : string|null = null
- $columns : array<string|int, string> = []
Tags
tagOrder()
タグの特定フィールドを指定して,昇順または降順で並び替えます
public
static tagOrder(SQL_Select &$SQL, string $order[, null $scope = null ]) : void
[example] name-desc : 名前降順
ACMS_Filter::tagOrder($SQL, 'name-desc');
Parameters
- $SQL : SQL_Select
- $order : string
-
asc|desc
- $scope : null = null
Tags
userField()
ユーザーをfieldテーブルから,指定されたフィールドで検索します
public
static userField(T &$SQL, Field_Search $Field) : void
ACMS_Filter::userField($SQL, $Field);
Parameters
- $SQL : T
- $Field : Field_Search
Tags
userKeyword()
ユーザーをfulltextテーブルから,指定されたキーワードで全文検索します
public
static userKeyword(T &$SQL, string $keyword) : void
ACMS_Filter::userKeyword($SQL, 'first second third keywords')
Parameters
- $SQL : T
- $keyword : string
Tags
userOrder()
ユーザーの特定フィールドを指定して,昇順または降順で並び替えます
public
static userOrder(SQL_Select &$SQL, string $order[, string|null $scp = null ]) : void
[example] id-desc : ID降順 code-asc : コード昇順
ACMS_Filter::userOrder($SQL, 'code-desc');
Parameters
- $SQL : SQL_Select
- $order : string
-
asc|desc
- $scp : string|null = null
Tags
userStatus()
ユーザーの公開状態とアクセス中の権限に応じて,表示条件を振り分けます
public
static userStatus(T &$SQL[, string|null $scope = null ]) : void
ACMS_Filter::userStatus($SQL);
Parameters
- $SQL : T
- $scope : string|null = null
Tags
_field()
field による絞り込みを行います
private
static _field(T &$SQL, Field_Search $Field[, "field_eid"|"field_cid"|"field_bid"|"field_uid"|null $fieldKey = null ][, string|null $tableKey = null ][, string|null $bScp = null ]) : array<string|int, string>
Parameters
- $SQL : T
- $Field : Field_Search
- $fieldKey : "field_eid"|"field_cid"|"field_bid"|"field_uid"|null = null
- $tableKey : string|null = null
-
結合先のテーブルのキー
- $bScp : string|null = null
-
結合先のエイリアス名
Tags
Return values
array<string|int, string> —ソートに利用するフィールド名の配列
_field_where()
指定したフィールド名のWhere句を組み立てます。 フィールドの結合子にemが含まれている場合は,falseを返します。
private
static _field_where(SQL_Where &$Where, Field_Search $Field, string $fd) : void
Parameters
- $Where : SQL_Where
- $Field : Field_Search
- $fd : string
-
フィールド名
Tags
_keyword()
_keyword
private
static _keyword(T &$SQL, string $keyword, "fulltext_eid"|"fulltext_cid"|"fulltext_bid"|"fulltext_uid" $fulltextKey, string $tableKey) : void
Parameters
- $SQL : T
- $keyword : string
- $fulltextKey : "fulltext_eid"|"fulltext_cid"|"fulltext_bid"|"fulltext_uid"
- $tableKey : string
-
結合先のテーブルのキー
Tags
splitKeyword()
キーワードの分割する
private
static splitKeyword(string $keyword) : array<string|int, string>
Parameters
- $keyword : string