Get the AttachmentLink for a specific attachable object and field name.

@param AttachableObjectInterface $object
@param string $fieldName

@return AttachmentLink
965569
public function getLinkForObject(AttachableObjectInterface $object, $fieldName = null)
    {
        return AttachmentLinkQuery::create()
            ->filterByAttachment($this)
            ->filterByAttachableObject($object)
            ->filterByModelField($fieldName)
            ->findOne()
        ;
    }
1230044
public static function getAttachmentsList($object)
    {
        $fburl       = $object->getFlexiBeeURL();
        $attachments = [];
        $oFormat = $object->format;
        $object->setFormat('json');
        $atch        = $object->getFlexiData($fburl.'/prilohy'.(count($object->defaultUrlParams)
                ? '?'.http_build_query($object->defaultUrlParams) : ''));
        $object->setFormat($oFormat);
        if (count($atch) && ($object->lastResponseCode == 200)) {
            foreach ($atch as $attachmentID => $attachmentData) {
                $attachments[$attachmentID]        = $attachmentData;
                $attachments[$attachmentID]['url'] = $object->url.'/c/'.$object->company.'/priloha/'.$attachmentData['id'];
            }
        }
        return $attachments;
    }
335226
public function readRef($fieldName)
    {
        $oRef = $this->readNestedAttribute($fieldName);
        if (!\MongoDBRef::isRef($oRef)) {
            throw new InvalidReferenceException();
        }
        if (isset($this->dbRefs) && isset($this->dbRefs[$fieldName])) {
            $modelInstance = $this->instantiateModel($this->dbRefs[$fieldName]);
        } else if ($this->getDI()->has('mongoMapper')) {
            $modelInstance = $this->getDI()->get('mongoMapper')->resolveModel($oRef['$ref']);
        } else {
            return $oRef;
        }
        return forward_static_call(array($modelInstance, 'findById'), $oRef['$id']);
    }
251925
protected function getFolderName(DataObject $object, $field)
    {
        // Initialise:
        
        $folder = null;
        
        // Locate File Handle Field:
        
        if ($fileField = $object->getCMSFields()->dataFieldByName($field)) {
            
            if ($fileField instanceof FileHandleField) {
                $folder = $fileField->getFolderName();
            }
            
        }
        
        // Answer Folder Name:
        
        return ($folder ? $folder : Upload::config()->uploads_folder);
    }
93265
public function getAttachment($attachmentIndex)
    {

        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/attachments/' . $attachmentIndex;
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        return $json->Attachment;
    }
1132491
public function getAttachment($attachmentName)
    {
        if ($attachmentName == '')
            throw new Exception('Attachment Name not specified');

        //build URI
        $strURI = Product::$baseProductUri . '/email/' . $this->getFileName() . '/attachments/' . $attachmentName;

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $v_output = Utils::validateOutput($responseStream);

        if ($v_output === '') {
            $outputFilename = $attachmentName;
            Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $outputFilename);
            return $outputFilename;
        } else {
            return $v_output;
        }
    }
307784
private function getPropertyValue($object, Property $field)
    {
        return $this->accessor->getValue($object, $field->getProperty());
    }
215956
public function setObjectName($objectName = null)
    {
        return parent::setObjectName(is_null($objectName) ? ( empty($this->getRecordIdent())
                    ? $this->getObjectName() : $this->getRecordIdent().'@'.$this->getObjectName() )
                    : $objectName);
    }
1122348
public function addField($field)
    {
        if ($field instanceof AttachmentField) {
            $this->fields[] = $field;

            return $this;
        } elseif (is_array($field)) {
            $this->fields[] = new AttachmentField($field);

            return $this;
        }

        throw new InvalidArgumentException('The attachment field must be an instance of Maknz\Slack\AttachmentField or a keyed array');
    }
673703
public function getFieldType($object, $field)
	{
		$metadata  = $this->manager->getClassMetadata(get_class($object));

		if ($metadata->hasField($field)) {
			return $metadata->getTypeOfField($field);
		} else if ($metadata->hasAssociation($field) && $metadata->isSingleValuedAssociation($field)) {
			return self::ASSOCIATION_TO_ONE;
		} else if ($metadata->hasAssociation($field) && $metadata->isCollectionValuedAssociation($field)) {
			return self::ASSOCIATION_TO_MANY;
		}

		return null;
	}
540035
private function getLinkset2Field($field)
	{					
        if (!isset($this->fields[$field['name']])) {
			$this->fields[$field['name']] =  new Iterator\Linkset2( $this, $field );
		}
        
		return $this->fields[$field['name']];   
    }
821289
protected function getPrivate($object, string $propertyName)
    {
        $objectArray = (array) $object;
        foreach ($objectArray as $name => $value) {
            if (substr($name, - \strlen($propertyName) - 1) === "\x00" . $propertyName) {
                return $value;
            }
        }

        return null;
    }
207549
public function addField(Field $field)
    {
        if (!isset($this->attachment['fields'])) {
            $this->attachment['fields'] = [];
        }

        $this->attachment['fields'][] = $field;

        return $this;
    }
237941
protected function saveToDatabase(File $file, AttachableObjectInterface $object, $fieldName, FileKey $fileKey, $customFilename = null)
    {
        $attachment = $this->getOrCreateAttachment($file, $object, $fieldName, $fileKey);
        $link = $this->createAttachmentLink($file, $object, $fieldName, $attachment, $customFilename);
        
        if (in_array($fieldName, $object->getAttachableFieldNames()))
        {
            $method = 'set'.$fieldName.'Attachment';
        
            if (!method_exists($object, $method))
            {
                throw new InvalidAttachableFieldNameException('Fieldname setter for '.$fieldName.' does not exist in '.get_class($object));
            }
            
            $object->$method($attachment);
            $link->setIsCurrent(true);
            
            AttachmentLinkQuery::create()
                ->filterByAttachableObject($object)
                ->filterByModelField($fieldName)
                ->doUpdate(array('IsCurrent' => false), \Propel::getConnection())
            ;
        }
        
        $link->save();
        
        return $attachment;
    }
836977
public static function getValue($object, $propertyName)
    {


        if (property_exists($object, $propertyName) || isset($object->$propertyName)) {
            try {
                return $object->$propertyName;
                // @codingStandardsIgnoreLine
            } catch (\BadFunctionCallException $e) {
                //Do nothing and continue
                // @codingStandardsIgnoreLine
            } catch (\InvalidArgumentException $e) {
                //Do nothing and continue
            }
        }


        throw new \InvalidArgumentException(
            vsprintf('The class "%s" does not have the property "%s" or it\'s not readable', array(
                get_class($object),
                $propertyName
            ))
        );
    }
893904
public function url($object = null)
    {
        if (is_object($object)) {
            $objectIdField = $this->objectIdField;

            return $this->urlName . '/' . $object->$objectIdField;
        } elseif ($object) {
            return $this->urlName . '/' . $object;
        }

        return $this->urlName;
    }
53219
protected function getGenericObject($fieldName, $objectType, $objectName = "object")
    {
        //====================================================================//
        // Load Pointed Object Id
        $objectId = $this->getObjectId($fieldName, $objectName);
        //====================================================================//
        // Push Object Id to Buffer
        $this->out[$fieldName] = $objectId
                ? self::objects()->encode($objectType, $objectId)
                : null;

        return $this;
    }