Overview
  • Namespace
  • Class

Namespaces

  • MatthiasWeb
    • RealMediaLibrary
      • api
      • attachment
      • base
      • comp
        • complexquery
      • folder
      • general
      • metadata
      • order
      • rest
      • usersettings
  • None

Classes

  • GalleryOrder
  • Sortable

Class Sortable

Handles the sortable content in the folder. The methods of this class contains always the keyword "content".

MatthiasWeb\RealMediaLibrary\base\Base
Extended by MatthiasWeb\RealMediaLibrary\folder\BaseFolder implements MatthiasWeb\RealMediaLibrary\api\IFolder
Extended by MatthiasWeb\RealMediaLibrary\folder\Creatable
Extended by MatthiasWeb\RealMediaLibrary\order\Sortable

Direct known subclasses

MatthiasWeb\RealMediaLibrary\folder\Collection, MatthiasWeb\RealMediaLibrary\folder\Folder, MatthiasWeb\RealMediaLibrary\folder\Gallery, MatthiasWeb\RealMediaLibrary\folder\Root

Abstract
Namespace: MatthiasWeb\RealMediaLibrary\order
Located at order/Sortable.class.php

Methods summary

public
# __construct( $id, $parent = -1, $name = "", $slug = "", $absolute = "", $order = -1, $cnt = 0, $row = array() )

C'tor with the main properties.

C'tor with the main properties.

The constructor does not throw any errors because when it is fully filled with parameters it expects the right properties from the database.

Only ::instance and ::create should create instances from this class!

Synced with order\Sortable::__construct

Overrides

MatthiasWeb\RealMediaLibrary\folder\Creatable::__construct
public true
# contentOrder( $attachmentId, $nextId, $lastIdInView = false )

See API function for more information.

See API function for more information.

Returns

true

Throws

Exception

See

wp_attachment_order_update()
public
# contentIndex( boolean $delete = true )

Index the order table.

Index the order table.

Parameters

$delete
Delete the old order

Returns

boolean
public
# contentReindex( )

This function retrieves the order of the order table and removes empty spaces, for example:

0 1 5 7 8 9 10 =>
0 1 2 3 4 5 6

This function retrieves the order of the order table and removes empty spaces, for example:

0 1 5 7 8 9 10 =>
0 1 2 3 4 5 6

Returns

boolean
public
# contentEnableOrder( )

Enable the order functionlity for this folder.

Enable the order functionlity for this folder.

See

IFolderContent::getContentCustomOrder()

Returns

boolean
public
# contentDeleteOrder( )

Deletes the complete order for this folder.

Deletes the complete order for this folder.

See

IFolderContent::getContentCustomOrder()

Returns

boolean
public
# contentRestoreOldCustomNr( )

Restore the current order number to the old custom order number.

Restore the current order number to the old custom order number.

Returns

boolean
public
# isContentCustomOrderAllowed( )
public
# getContentCustomOrder( )

The content custom order defines the state of the content order functionality:

The content custom order defines the state of the content order functionality:

0 = No content order defined
1 = Content order is enabled
2 = Custom content order is not allowed

See

IFolderContent::isContentCustomOrderAllowed()
IFolderContent::contentEnableOrder()

Returns

integer The content custom order value
public
# getAttachmentNextTo( integer $attachmentId )

Get the next attachment id for a specific attachment. It returns false if the attachment is at the end or the folder has no custom content order.

Get the next attachment id for a specific attachment. It returns false if the attachment is at the end or the folder has no custom content order.

Parameters

$attachmentId
The attachment id

Returns

boolean Int or false
public
# getContentOrderNumbers( boolean $fromCache = true, boolean $indexMode = true )

Get the whole order table.

Get the whole order table.

Parameters

$fromCache
load the data from the cache
$indexMode
the return is an indexed array with attachment id key

Returns

boolean|int[]
public
# getContentAggregationNr( string $function = "MAX" )

Gets the biggest order number;

Gets the biggest order number;

Parameters

$function
The SQL aggregation function (MIN or MAX)

Returns

integer
public integer|boolean
# getContentNrOf( integer $attachmentId )

Get the order number for a specific attachment in this folder.

Get the order number for a specific attachment in this folder.

Parameters

$attachmentId
The attachment id

Returns

integer|boolean
public
# getContentOldCustomNrCount( )

Get the old custom order number count so we can decide if already available.

Get the old custom order number count so we can decide if already available.

Returns

int Count
public static
# item_move_finished( $folderId, $ids, $folder, $isShortcut )
public static
# folder_insert_anyParentHasMetadata( $conditions, $folder, $args )

Add a condition for the automatic order

Add a condition for the automatic order

public static
# folder_insert_anyParentHasMetadata_orderAutomatically( $metas, $folder, $args, $all_metas )
public static
# posts_clauses( $pieces, $query )

JOIN the order table and orderby the nr. It is only affected when $query = new \WP_Query(array( 'post_status' => 'inherit', 'post_type' => 'attachment', 'rml_folder' => 4, 'orderby' => 'rml' ));

JOIN the order table and orderby the nr. It is only affected when $query = new \WP_Query(array( 'post_status' => 'inherit', 'post_type' => 'attachment', 'rml_folder' => 4, 'orderby' => 'rml' ));

public static
# mla_media_modal_query_final_terms( $query )

Media Library Assistent extension.

Media Library Assistent extension.

public static
# delete_all_order( )

Deletes the complete order. Use it with CAUTION!

Deletes the complete order. Use it with CAUTION!

Methods inherited from MatthiasWeb\RealMediaLibrary\folder\Creatable

addChildren(), getMaxOrder(), getRowData(), getTypeDescription(), getTypeName(), insert(), isValidName(), persist(), read(), reindexChildrens(), relocate(), setName(), setParent(), singleCheckInsert(), singleCheckInsertPermissions(), updateThisAndChildrensAbsolutePath(), xread()

Methods inherited from MatthiasWeb\RealMediaLibrary\folder\BaseFolder

anyChildrenHas(), anyChildrenHasMetadata(), anyParentHas(), anyParentHasMetadata(), getAbsolutePath(), getAllParents(), getChildren(), getCnt(), getId(), getName(), getOrder(), getOwner(), getParent(), getPath(), getPlain(), getRestrictions(), getRestrictionsCount(), getSlug(), hasChildren(), is(), isRestrictFor(), isValidChildrenType(), setRestrictions()

Methods inherited from MatthiasWeb\RealMediaLibrary\base\Base

debug(), getCore(), getTableName()

Methods inherited from MatthiasWeb\RealMediaLibrary\api\IFolder

getAllowedChildrenTypes(), getType()

Properties summary

Properties inherited from MatthiasWeb\RealMediaLibrary\folder\BaseFolder

$absolutePath, $children, $cnt, $contentCustomOrder, $id, $name, $order, $orderNumbers, $parent, $restrictions, $restrictionsCount, $row, $slug, $systemReservedFolders

API documentation generated by ApiGen